If you are determine if the last day is a Thursday then
DayofWeek should have worked for you.

<CFIF DayOfWeek(varToday) EQ 5 >
        Today is Thursday
</CFIF>


If you are trying to determine when the last Thursday was for the month,
<CFSET varDayofWeekEOM = DayOfWeek(varToday)>
<CFIF varDayofWeekEOM LT 5>
        <cfset varMinusDays = (5 - varDayofWeekEOM)  + 3>
<CFELSEif varDayofWeekEOM GT 5>
        <cfset varMinusDays = varDayofWeekEOM - 5>
<CFELSE>
        <cfset varMinusDays = 0>
</CFIF>
<CFSET lastThursdayofMonth = DateAdd('d',varMinusDays,varToday)>


Something like that, not tested it and I have no doubts, maybe a better
way.


-----Original Message-----
From: Eric Creese [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 20, 2005 11:19 AM
To: CF-Talk
Subject: OT-SQL DATE QUESTION

Okay I have a function that retrieves the last day of the month based on
feeding it todays date which would return 1/31/2005. I am trying to
modify this function to determin if today is the last Thursday of the
month. Does anyone have any ideas for this? I have tried a few things
like using the day of the week number but I am getting nothing and
looked out on the web and have not found much. This is for SQL2K




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware: a new and convenient web-based time tracking application. Start 
tracking and documenting hours spent on a project or with a client with Logware 
today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191212
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to