Your best bet for portability with dates imho is going to be using
cfqueryparam... ms sql server only supports cf_sql_timestamp as a data
type, though fortunately I believe that'll also work for other
databases as well.

> CF 5
> MS Access 2002

> The following code works on my server/DB, but I am
> concerned about
> portability. The concern is that the dates are in
> different formats. And,
> yes I am guilty of being the hacker/creator, but I can't
> see a more elegant
> way to accomplish the task.

> OUTPUT:
> End Date: {d '2003-11-19'}
> Start Date: {ts '2003-11-07 00:00:00'}

> Any suggestions?

> Thanks,

> Nick

> <cfset StartDate = DateAdd("d", -12, URL.EndDate) >
> <p><cfoutput>
>    EndDate: #URL.EndDate#<br>
>    StartDate: #StartDate#
> </cfoutput></p>

> <cfquery name = "GetResults" dataSource = "Events">
> SELECT *
> FROM  Locations
> Where Location = 'LA' AND StartTime BETWEEN #StartDate#
> and #URL.EndDate#
> </cfquery>

> StartTime  Location  Event<BR>

> <cfoutput query="GetResults">
> #StartTime#   #Location#  #Event#<BR>
> </cfoutput>

>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to