Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Query: IF date = current month, sum sales, 0) How do I make this work?

$
0
0
I have a query that I need three columns One for this month, last month and 2 months ago. Instead of using a crosstab query I want to put this into a regular query.

I figure the formula would work something like this

IIF(Date = current month, sum(sales),0) Im not sure how to make the date=current month part work.

Viewing all articles
Browse latest Browse all 13329

Trending Articles