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!

Summarizing dates quarterly using U.S. calendar 2

Status
Not open for further replies.

drussum

Programmer
Jan 31, 2002
38
US
I have a table that is storing dates in short date format. I need to write a qry that will display the results (Number of units in back log) By month. so the column headings will read Jan through Dec. Any help Ideas or resources would really be appreciated. I am an entry level programmer (Just less than 1 Year)with access, sql and vba so please try to keep it decipherable. :)
 
You can create a query using a group by on the Unit Type field and specify 12 calculated fields similar to this:

Jan:=iif(datepart("m",[order_date])=1,1,0)
Feb:=iif(datepart("m",[order_date])=2,1,0)
etc...

And use the Sum function for these fields, you should get your desired results...
 
JUst look int the crosstab query. Ms. A has a 'wizzard' to get te basic query set up for you. 10 Minutes of 'play time' with the wizz will be better than an hour trying to understand the explination.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thank you for your help. in the first example, Jan:=iif(datepart("m",[order_date])=1,1,0)
Feb:=iif(datepart("m",[order_date])=2,1,0)
etc...
do I need to enter the field name somewhere? How does the above statement know what field it it working with? I am sorry if I am a bit slow, but I would really appreciate any response you might have time for. Thanks again for your generosity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top