Loose the pound (#) signs inside <CFSET> tag, no need for them and are you sure that the form variable is spelled right,try to output it before doing anything else with it... besides that you need to put '' around the "where my_date <= '#start_date#'" If the my_date field is a TEXT field that is... -----Original Message----- From: SHEETS, DAYV (PB) [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 1:51 PM To: CF-Server Subject: RE: Weekly Date Driven Content in Cold Fusion? Yep - and I also tried it using the Date/Time stamp... When I attempt to try your suggestion, I receive the following error: <snip> =============================== Error Diagnostic Information An error occurred while evaluating the expression: my_date = #CreateODBCDate(FORM.my_date_column, "mm/dd/yyyy")# Error near line 1, column 7. ---------------------------------------------------------------------------- ---- Error resolving parameter FORM.MY_DATE_COLUMN The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name. The error occurred while processing an element with a general identifier of (CFSET), occupying document position (1:1) to (1:69). </snip> =============================== My page looks like this - =============================== <snip> <CFSET my_date = #CreateODBCDate(FORM.my_date_column, "mm/dd/yyyy")#> <CFSET start_date = #CreateODBCDate(FORM.start_date, "mm/dd/yyyy")#> <CFSET end_date = #CreateODBCDate(FORM.end_date, "mm/dd/yyyy")#> <cfquery name="weekly" datasource="temp"> select * from weekly where my_date >= #start_date# and my_date_column <= #end_date# </cfquery> </snip> =============================== ..... any advise... ? besides the obvious (pull my hair out) ;) TA, Dayv -----Original Message----- From: Hong, Tammy T [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 1:10 PM To: CF-Server Subject: RE: Weekly Date Driven Content in Cold Fusion? Humm have you formatted to ODBC?? Not sure if this will help or perhaps you have done this already?? Just curious but why is my_date_column TEXT instead of Date/Time data type?? <CFSET my_date = #CreateODBCDate(FORM.my_date_column, "mm/dd/yyyy")#> <CFSET start_date = #CreateODBCDate(FORM.start_date, "mm/dd/yyyy")#> <CFSET end_date = #CreateODBCDate(FORM.end_date, "mm/dd/yyyy")#> then query DB: <cfquery name="weekly" datasource="temp"> select * from weekly where my_date >= #start_date# and my_date_column <= #end_date# </cfquery> -T -----Original Message----- From: SHEETS, DAYV (PB) [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 2:34 PM To: CF-Server Subject: RE: Weekly Date Driven Content in Cold Fusion? Ack - I am still having difficulty using the code provided. For some reason I keep receiving an error. I used the following example provided (for now, I am using access as the db): <!--weekly.cfm--> <cfset date_in = #createodbcdate(now())#> <cfquery name="weekly" datasource="temp"> select * from weekly where my_date_column >= #form.start_date# and my_date_column <= #form.end_date# </cfquery> On my database, I have the following feilds: QuoteID =>AutoNumber Quote =>Memo Author =>Memo start_date =>Date/Time end_date =>Date/Time my_date_column =>Text When the page is executed, I receive the following error: <snip> Error Diagnostic Information An error occurred while evaluating the expression: #form.start_date# Error near line 4, column 51. ---------------------------------------------------------------------------- ---- Error resolving parameter FORM.START_DATE The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name. The error occurred while processing an element with a general identifier of (#form.start_date#), occupying document position (4:50) to (4:66). </snip> -Ack!- Can someone tell me what I need to correct in order to get it to work (with the relevent codes entirety)? Thanks, Dayv -----Original Message----- From: SHEETS, DAYV (PB) [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 1:26 PM To: CF-Server Subject: RE: Weekly Date Driven Content in Cold Fusion? So should I name the column "my_date_column" and if the date falls within the date span from the current date it will then be displayed, OR should I instead have two columns; one named "start_date" and one named "end_date"? Please clarify... Thanks again for all of your responses! :) Dayv -----Original Message----- From: Heath Tucker [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 7:13 AM To: CF-Server Subject: Re: Weekly Date Driven Content in Cold Fusion? I would go so far as to run a dateformat statement on the input dates to insure they are read correctly. #DateFormat(Now(),"mm/dd/yyyy")# <cfquery name="..." datasource="..."> SELECT * FROM mytable WHERE my_date_column >= #DateFormat(form.start_date,"mm/dd/yyyy")# and my_date_column <= #DateFormat(form.end_date,"mm/dd/yyyy")# </cfquery> ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "CF-Server" <[EMAIL PROTECTED]> Sent: Friday, April 20, 2001 8:40 AM Subject: Re: Weekly Date Driven Content in Cold Fusion? > > > I think he actually wants something like this: > <cfquery name="..." datasource="..."> > select * from mytable where my_date_column >= #form.start_date# and > my_date_column <= #form.end_date# > </cfquery> > > > tom > > > > Of course! > > try somethig like this: > > <cfquery name="..." datasource="..."> > select * from mytable where start_date <= #createodbcdate(now())# and > end_date >= #createodbcdate(now())# > </cfquery> > > Alejandro Mozo Quesada > Sistemas / Programaci > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm ------------------------------------------------------------------------------ To unsubscribe, send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body or visit the list page at www.houseoffusion.com
RE: Weekly Date Driven Content in Cold Fusion?
Tomas Becklin :: Web Developer Fri, 20 Apr 2001 14:15:50 -0700
- RE: Weekly Date Driven Content in Cold Fusi... Stephen Kellogg
- Re: Weekly Date Driven Content in Cold Fusi... Alejandro Mozo
- Re: Weekly Date Driven Content in Cold Fusi... tom . woiccak
- Re: Weekly Date Driven Content in Cold... Heath Tucker
- Re: Weekly Date Driven Content in Cold Fusi... Consultant
- RE: Weekly Date Driven Content in Cold Fusi... SHEETS, DAYV (PB)
- RE: Weekly Date Driven Content in Cold Fusi... Stephen Kellogg
- RE: Weekly Date Driven Content in Cold Fusi... SHEETS, DAYV (PB)
- RE: Weekly Date Driven Content in Cold Fusi... Hong, Tammy T
- RE: Weekly Date Driven Content in Cold Fusi... SHEETS, DAYV (PB)
- Re: Weekly Date Driven Content in Cold Fusi... Tomas Becklin :: Web Developer
- Re: Weekly Date Driven Content in Cold Fusi... Alejandro Mozo
- Re: Weekly Date Driven Content in Cold Fusi... samir yousef
- RE: Weekly Date Driven Content in Cold Fusi... SHEETS, DAYV (PB)
