Here is how I get my week numbers:

SELECT COUNT(Requests.RequestID) AS TotalRequests,
    COUNT(Entries.EntryID) AS TotalEntries, DATEPART(wk,
    Requests.RequestDate) AS RequestDatePart, DATEPART(yy,
    Requests.RequestDate) AS YearPart
FROM Entries RIGHT OUTER JOIN
    Requests ON
    Entries.RequestID = Requests.RequestID
WHERE (Requests.PromoID = 2)
GROUP BY DATEPART(wk, Requests.RequestDate), DATEPART(yy,
    Requests.RequestDate)
ORDER BY YearPart, RequestDatePart

TotalRequest TotalEntries RequestDatePart       Yearpart
    934           75           50           2001
    784           85           51           2001

Sunday to Saturday weeks




-----Original Message-----
From: Tom Nunamaker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 5:12 PM
To: CF-Talk
Subject: RE: Week Number = date range ?


How do you define your week?  Does it always start the same day of the
week or is it based on the 1st of January's day of the week (changing
every year)?

Tom Nunamaker
Paladin Computers
Macromedia Certified Advanced ColdFusion 5.0 Developer
http://www.toshop.com/
[EMAIL PROTECTED]

-----Original Message-----
From: Jeff Green [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 6:59 PM
To: CF-Talk
Subject: RE: Week Number = date range ?


I dont think that will work for me.  I think I would need to know the
date in order to use the tag, I dont have the date available.  I have a
week number and year, thats it.  I need to determine the first day in
that week and/or last day.

jeff
-----Original Message-----
From: Steve Oliver [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 4:44 PM
To: CF-Talk
Subject: RE: Week Number = date range ?


The best way would probably be to convert the Julian date, which is just
the number of the day out of 365 days, and then add 7 to it using
dateadd.  There's a tag for converting to and from Julian dates at this
URL.

http://www.zyxxy.com/cf_bit/julian/index.cfm?opt=julian&subID=4


______________________
steve oliver
atnet solutions, inc.
http://www.atnetsolutions.com


-----Original Message-----
From: Jeff Green [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 7:18 PM
To: CF-Talk
Subject: Week Number = date range ?


Hi all,

Anyone out there have some logic to figure out what date range a
particular week number is?

Example:
Week #39 in 2001 = sep/16 - sep/22

I thought I this working, but it blew up around week 52 and 53 :(

I query for aggregate stats by the week, so the query returns week
number and year.

Thanks,
Jeff





______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
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

Reply via email to