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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating Weekending dates

Status
Not open for further replies.

JuanSanchez

Programmer
Oct 16, 2000
24
US
I'm trying to generate a weekending date from a date pulled from a ms sql databse. This is very sparse but I dont do alot of math functions. Here's what I have....

<cfquery name=&quot;WE&quot; datasource=&quot;payroll&quot; username=&quot;abc&quot; password=&quot;123&quot;>
select subcutoff from TblDistricts where rr = '10'
</cfquery>

<cfoutput query=&quot;WE&quot;>
<cfset weekending1=#subcutoff# + 6>
</cfoutput>

I need to get the next 2 week endings and the week ends on a saturday for our work purposes #Subcutoff# will always be a monday and that is the date that gets changed in the database. so right no that date is 11/13/00 3:15:00 PM its in odbc format, for the web page the time is not important.
I need to create a dropdown with the new week endings so when a work order is requested they can pick the current week ending or the next week ending for the order to be completed by. I hope that wasn't to long winded.

Thanks in advance,
Jon Warner
 
Hey I figured it out myself here's the answer!
hehe

Code:
<cfquery name=&quot;WE&quot; datasource=&quot;payroll&quot; username=&quot;abc&quot; password=&quot;123&quot;>
  select subcutoff from TblDistricts where rr = '10'
</cfquery>

<cfoutput query=&quot;WE&quot;>
<cfset weekending1 = (DateAdd(&quot;d&quot;, 5, #subcutoff#))>
<cfset weekending2 = (DateAdd(&quot;d&quot;, 12, #subcutoff#))>
<cfset showending1 = LSDateFormat(#weekending1#, &quot;mmm-dd-yyyy&quot;) >
<cfset showending2 = LSDateFormat(#weekending2#, &quot;mmm-dd-yyyy&quot;) >

<cfselect name=&quot;processWEdate&quot;>
   <option value=&quot;#showending1#&quot;>#showending1#
   <option value=&quot;#showending2#&quot;>#showending2#
</cfselect>

</cfoutput>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top