This content has been marked as final. Show 8 replies
There are two reasons why your code might not actually run. First, you have code for one value of form.vider but if it's coming from a select, there is more than one available value. Second, that code will only run if ydate is defined.
You say you think you defined ydate at the beginning of your code. I know you didn't set it in the code you showed us.
Text <cfif IsDefined("ydate") And IsDefined("vider") And FORM.vider IS "Somone"> that is not setting ydate????? I thought you set it at the begining of the <cfif> is that not correct?????
Then i tried it here too....which one is best at the begining or right before you will be using the value......
<cfquery datasource="bashful" name="res">
Select * From Patients where doc_code ='RA' and date_seen LIKE '%#ydate#' Order By last_name ASC
<CFIF IsDefined("ydate") does not set it. You may be thinking of CFPARAM NAME="ydate" DEFAULT="">
Ok so what sets "ydate" then??????? i thought <cfset> was all i needed??? Is that not correct.....do i need to make a <cfparam>????or what.....any help!!!
What is ydate, and where does it come from? Do you want it to come from a form? From a database? From a hard-coded CFSET? From CFPARAM? Show the code where ydate gets defined.
I suggest translating your code to simple english, reading it, and seeing if that is really what you want to do. If it's not, change the plain english and base your code on the new version.
<cfset ydate = something>
translates to, "if ydate is there, create it". Is that what you had in mind?
This is my code where i believe i have created my ydate varible correctly....and i change my <select> to just a <input type = "text" name="vider"> so i am making descisions based on what value the textbox holds....the ydate is passed to a SQL statment that pulls clients that have appointments two days ahead of the current day......But the textbox holds the same info for all fo them and thats the part that just has me stuck...since i am from the .Net world of SelectedItem properties....but thanks for all the help!!!! If ydate is not defined right please tell me what i should do! please!
U need to change your code structure making sure the Query is at the top of when u try and use your result set and forget that complicated <cfswitch> just hard code the value that should be change in tdate so if its <cfif tdate IS 1> <cfset tdate TO 3> get it????? but that fixed my problems....One thing good about coldfusion it seems it likes real simple code...but anyway here is the code thats works...thanks self!