freelanceprogrammers.org Forum Index » Cold Fusion

SQL Query Help


Goto page Previous  1, 2
View user's profile Post To page top
bhhightower Posted: Tue Apr 05, 2005 3:16 pm


Joined: 10 Sep 2002

Posts: 9
SQL Query Help
Try putting single tics around your dates like this

<cfset start_yr1 = start_yr + q -1>
<cfset start_yr1 = "12/31/" & start_yr1>
<cfset start_yr1 = DateFormat(start_yr1,"yyyy/mm/dd")>
<cfset end_yr1 = start_yr + q + 1>
<cfset end_yr1 = "1/1/" & end_yr1>
<cfset end_yr1 = DateFormat(end_yr1,"yyyy/mm/dd")>

<cfquery name="colA" datasource="#ds">
SELECT ID from people
where Entered_Program BETWEEN `#CreateODBCDate(start_yr1)#`
AND `#CreateODBCDate(end_yr1)#`
AND HID = #dist_site.ID#
</cfquery>

<cfquery name="colB" datasource="#ds#">
SELECT ID from people
where Graduation BETWEEN `#CreateODBCDate(start_yr1)#`
AND `#CreateODBCDate(end_yr1)#`
AND HID = #dist_site.ID#
</cfquery>


<cfquery name="colC" datasource="#ds#">
SELECT ID from people
where Entered_Program > `#CreateODBCDate(start_yr1)#`
AND Graduation < `#CreateODBCDate(end_yr1)#`
AND HID = #dist_site.ID#
</cfquery>

-----Original Message-----
From: Jennifer [mailto:chrystalheart@...]
Sent: Monday, April 04, 2005 7:58 PM
To: cold_fusion@yahoogroups.com
Subject: [cold_fusion] Re: SQL Query Help



Then I saw it was dashes, not slashes, and I changed those, but got
the same error.

Jen







Yahoo! Groups Links
Reply with quote
Send private message
View user's profile Post To page top
Chrystalheart Posted: Tue Apr 05, 2005 6:29 pm


Joined: 05 Apr 2005

Posts: 37
SQL Query Help
Still no luck.

--- In cold_fusion@yahoogroups.com, "Brannon Hightower"
<hightower@a...> wrote:
> Try putting single tics around your dates like this
Reply with quote
Send private message
Goto page Previous  1, 2
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 2 of 2
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help