November 20, 2014 at 11:44 am
How do I make this a sql statement?
----------------------------------------------------------------------------------------------
if DATEOFPAYMENT = yesterday then PaymentAmount else 0 as 'previous day'
or
if DATEOFPAYMENT = current_Month then PaymentAmount else 0 as 'MTD'
or
if DATEOFPAYMENT = current_Year then PaymentAmount else 0 as 'YTD
November 20, 2014 at 11:51 am
have a look at the case statement and use it in your select query. It will have a performance hit. Have you als othought of creting a lookup table and joining to it to translate values?
November 20, 2014 at 11:56 am
No I haven't and I don't know how
November 20, 2014 at 12:02 pm
Here you go:
November 20, 2014 at 12:04 pm
I'm working off of the test server
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy