Nobody answered so I thought I would ask if someone has an answer?
Steven Lancaster
Barrios Technology
NASA/JSC
281-244-2444 (voice)
[EMAIL PROTECTED]
-----Original Message-----
From: LANCASTER, STEVEN M. (JSC-OL) (BAR)
Sent: Wednesday, April 03, 2002 7:33 AM
To: CF-Talk
Subject: HELP!!! Date problems
I have a database with holiday dates in it. I have a date (duedate) and I
want to see if duedate has a holidaydate between now and duedate. I also
want to see if the duedate lands on a holiday. If there is a holiday then I
want to subract 1 day from duedate. Shouldn't this give me what I need?
<CFLOOP QUERY="GetHolidaydate">
<CFIF ((DateCompare(DATEDUE,
"#CreateOdbcDate(holiday_date)#") IS 1) AND
(DateCompare(NEWDATE,
"#CreateOdbcDate(holiday_date)#") IS -1)) OR
(DateCompare(DATEDUE,
"#CreateOdbcDate(holiday_date)#") IS 0)>
<CFSET NEWDATE3 = "#DateAdd('D', -1,
DATEDUE)#">
</CFIF>
<CFIF DAY IS "Sunday">
<CFSET DATEDUE =
"#DateAdd('D', -2, DATEDUE)#">
</CFIF>
<CFIF DAY IS "Saturday">
<CFSET DATEDUE =
"#DATEADD('D', -1, DATEDUE)#">
</CFIF>
<!--- QUERY FOR A HOLIDAY COUNT --->
<CFQUERY
DATASOURCE="#application.lldbDatasource#" name="GetHolidayCount">
select count(1) hlday_cnt
from ll_holiday
where
#CreateOdbcDate(holiday_date)# = #CreateODBCDate(DATEDUE)#
</CFQUERY>
<CFIF GetHolidayCount.hlday_cnt EQ
"1">
<CFSET DATEDUE =
"#DATEADD('D', -1, DATEDUE)#">
</CFIF>
</CFLOOP>
Steven Lancaster
Barrios Technology
NASA/JSC
281-244-2444 (voice)
[EMAIL PROTECTED]
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists