Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I select the DatePart from date field?

Status
Not open for further replies.

Smapty

Programmer
Mar 12, 2005
55
US
I can't understand why this isn't working...

Code:
<CFQUERY NAME="GetSessions" DATASOURCE="#sourcename#">
SELECT DatePart(d, start_time) AS DayPart
FROM Sessions
</CFQUERY>
 
Nevermind, I think I got it now....

Code:
<CFQUERY NAME="GetSessions" DATASOURCE="#sourcename#">
SELECT day(start_time) AS DayPart, start_time, stop_time, title
FROM Sessions
GROUP BY start_time, stop_time, title
</CFQUERY>
 
your GROUP BY is superfluous, unless your table actually contains multiple rows with the same combination of start_time, stop_time, and title

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top