Thanks
-Original Message-
From: Joe Rinehart [mailto:[EMAIL PROTECTED]
Sent: Friday, December 31, 2004 1:51 PM
To: CF-Talk
Subject: Re: Extract year from date field
> How do I extract the year from a date field such as 2005-10-12?
>
> select distinct(datepart(m,report_date))
> How do I extract the year from a date field such as 2005-10-12?
>
> select distinct(datepart(m,report_date)) as month from report
> where datepart(yy,report_date) = '2005'
>
Not to be a wiseass...but if that's the query, it'll always be 2005 :)
It looks like your query gets all of the months
Thank you Sean. How can I apply the DISTINCT to the year as well?
It gives me an error when I add it in front of datepart(yy,report_date)
-Original Message-
From: Sean Corfield [mailto:[EMAIL PROTECTED]
Sent: Friday, December 31, 2004 12:49 PM
To: CF-Talk
Subject: Re: Extract year from
On Fri, 31 Dec 2004 10:43:43 -0500, Robert Orlini <[EMAIL PROTECTED]> wrote:
> How do I extract the year from a date field such as 2005-10-12?
>
>
> select distinct(datepart(m,report_date)) as month from report
> where datepart(yy,report_date) = '2005'
>
You need to change your query so returns
In cf?? Year(date)
Pascal
> -Original Message-
> From: Robert Orlini [mailto:[EMAIL PROTECTED]
> Sent: 31 December 2004 16:57
> To: CF-Talk
> Subject: RE: Extract year from date field
>
> Thanks Jochem. How would I extract the year from 2005-10-12 please?
>
Robert Orlini wrote:
> Thanks Jochem. How would I extract the year from 2005-10-12 please?
Year().
Jochem
~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.ho
dateformat(variable, '')
That should do the trick.
--Ben
Robert Orlini wrote:
> Thanks Jochem. How would I extract the year from 2005-10-12 please?
~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
h
Thanks Jochem. How would I extract the year from 2005-10-12 please?
-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Friday, December 31, 2004 10:47 AM
To: CF-Talk
Subject: Re: Extract year from date field
Robert Orlini wrote:
> How do I extract the year f
Robert Orlini wrote:
> How do I extract the year from a date field such as 2005-10-12?
>
> I'm using datepart in the Query as:
>
> datepart(yy,report_date),
>
> but when I try to output it as:
>
> #datepart("",
> populatedropdown.report_date)#
>
> it gives an form field not found erro
9 matches
Mail list logo