Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need to calc a month for display

Author  Topic 

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-08-11 : 12:47:09
Hi, in this SQL:

SELECT SOP10200.XTNDPRCE Price, SOP10200.QUANTITY quantity, DATEADD(WK,DATEDIFF(WK,0,SOP10100.DOCDATE),0) ID,

the field ID is created, as a holding field for the actual date (which in this case is a 'week of' mmddyy.

I would like now to get a similar holding field, for the month year of this Docdate.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-11 : 13:38:11
Isn't that exactly where rohitkumar did for you here?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=130948


Be One with the Optimizer
TG
Go to Top of Page

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-08-11 : 14:04:32
Thank you there TG, but the Report Services is not passing back a value:
Sales Summary by month+ CSTR(FIELDS!IDVALUE)

ID needs to have month i.e. November
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-11 : 14:16:39
datename(month, docDate)

Be One with the Optimizer
TG
Go to Top of Page

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-08-11 : 14:19:43
Excellent, excellent.

I have added the year there now as well.
Go to Top of Page
   

- Advertisement -