Duane,

Assuming you use SQL Server, you could do the following:

convert(varchar(10), t1.datefield, 110)

That should produce a result in the "mm-dd-yyyy" format.

Best,
Seva Petrov
Senior Developer
TheSquare.com


> -----Original Message-----
> From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 1:17 PM
> To: CF-Talk
> Subject: SQL Convert and joining on date
> 
> 
> Hi All,
> 
> In a query I am working on I am trying to do a join based on 
> date, but all
> dates are stored as yyyy-mm-dd hh:mm:ss (small date) and I 
> want to join
> based on yyyy-mm-dd.
> 
> I can not find any actual samples in SQL BOL on using the 
> CONVERT function
> to format dates. Can some lend a hand?
> 
> <cfquery ....>
>       SELECT SUM(t1.f1) AS totF1,
>              SUM(t2.f2) AS totF2,
> 
>       FROM     t1, t2
>       WHERE    CONVERT(t1.datefield,?????) = 
> CONVERT(t2.datefield,?????)
>       ....
> </cfquery ....>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to