- see footer for list info -<
I know I should have used ODBC dates for evrything etc etc ... but can anyone explain this one to me please ...

I have a query ....

<!--- Query the events for this month. --->
<cfquery name="GetEvents" datasource="#application.CalendarDSN#">
SELECT tblEvent.EventIDPK,
tblEvent.EventName,
tblEvent.StartDateTime,
Day(tblEvent.StartDateTime) AS EventStartDay,
Day(tblEvent.EndDateTime) AS EventEndDay,
tblEvent.EndDateTime,
tblEventType_Ref.EventTypeColor,
tblEventType_Ref.EventType
FROM tblEvent
INNER JOIN tblEventType_Ref ON tblEvent.EventTypeIDFK = tblEventType_Ref.EventTypeIDPK
WHERE (tblevent.StartDateTime BETWEEN #StartDate# AND #EndDateTime#)

<!---
OR EndDateTime BETWEEN #StartDate# AND #EndDateTime#
OR #StartDate# BETWEEN StartDate AND EndDateTime)
--->

<cfif IsDefined("URL.EventTypeID") AND IsNumeric(URL.EventTypeID)>
AND EventTypeIDFK = #URL.EventTypeID#
</cfif>
ORDER BY StartDateTime
</cfquery>

Now this should return all the events in a particular month. which works fine until an event spans across 2 months

The dates are stored in a MSSQL table in the datetime format

for example 31/10/2005 07:00:00  01/11/2005 23:59:59


So if I run this query on the SQL server in query analyzer (obviuosly substituting the variables for typed dates & times) then it works.

If I run the same thing in the CFQUERY  then it doesn't return anythig ...

I just can't get my head around this one ...

Regards - Paul


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to