ok,

then try this, i hope  it will work out.

select convert(char,Datefield,10) from tablename  ------> to get in mm-dd-yy
format
select convert(char,Datefield,11) from tablename  ------> to get in yy-mm-dd
format

nagesh

-----Original Message-----
From: Nathan Chen [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 05, 2000 12:24 PM
To: [EMAIL PROTECTED]
Subject: Re: How to extract date value?


Thanks, but I tried the syntax but didn't work.  By the way I want to do it
in the SQL query(inside <cfquery...>), I am not trying to display the
result.
--Nathan

Nagesh Kumar Deva wrote:

> if u r using sql server then there is a date function called dateformat()
it
> gives date value from datetime so u need to give in action page while
> retrieving the records dateformat(datefield,"YYYY/MM/DD")
>
> nagesh
>
> -----Original Message-----
> From: Nathan Chen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 05, 2000 11:57 AM
> To: cftalk
> Subject: How to extract date value?
>
> Hi Everyone,
>
> I am trying to put a group by clause in my query and the field I want to
> group by is a  date/time field in my table. But because almost every
> record has different time, even there are several records existed for
> the same day, they won't group.  For example, one record is "5/4/00
> 3:15:00 PM" and the other is "5/4/00 3:40:00 PM".  They won't group
> because of the time difference.  What's the function in SQL that
> extracts date value from a date/time field?  I used "datevalue" but it
> didn't help?  Any idea?  Thanks.
>
> --
> Nathan Chen
> (208)-426-8470
> Computer Control Systems, Inc.
>
>
----------------------------------------------------------------------------
> --
> 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.

--
Nathan Chen
(208)-426-8470
Computer Control Systems, Inc.


----------------------------------------------------------------------------
--
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