Date Formatting is very important....

i have learned from using both Access and Oracle that is important that in
your queries for Date Fields you find out that Database's preferred
format....and DateFormat Now or any other date...

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Michael Kear
> Sent: Wednesday, March 29, 2000 10:40 PM
> To: [EMAIL PROTECTED]
> Subject: Date Comparisons - what's wrong here?
>
>
> I've got a date stored in my SQL7 database.  When someone comes to the
> site, I want to compare this date with Now() to see if they were here
> today.
>
> But it's just not happening for me.  (Sigh - dates are always my nemesis!)
> What am I doing wrong please?
>
> The field in the SQL7 database is a datetime field, named whenvotes which
> is brought to the template by the query testvoter:
>
> <CFQUERY NAME="testvoter" DATASOURCE="datasource">
> SELECT      whenvotes, remote_addr
> FROM         poll_bank_1
> Where remote_addr='#remote_addr#'
> </CFQUERY>.
>
> So to check if they were here today, I'm using the following:
>
> <!--- turn ODBC Date into ColdFusion date format ---->
> <cfset datevoted=parsedatetime(testvoter.whenvotes)>
> <!---  compare to now - if dates are equal result is zero ---->
>  <cfif  (datecompare('datevoted','now()') is '0')>
>
> But the result I'm getting is an error message thus:
>
> The date parameter of function ParseDateTime(date), which is , does not
> represent a valid date
>
> The error occurred while evaluating the expression:
>
>  datevoted=parsedatetime(testvoter.whenvotes)
>
> The error occurred while processing an element with a general identifier
> of (CFSET), occupying document
>
>
> ------------------------------------------------------------------
> ------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to