Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have campaignmetrics table, where it as campaign_start_date, here i have to get rows, where campaign_start_date contains date of previous month dates.
How could i get these rows. Please help me on this any help is appreciated.
Regards
have you tried this logic in where clause of your table load?
Month(campaign_start_date) <MONTH(TODAY())
for previous month
you can check the month start of campaign_start_date is the same as monthstart of 1 month ago
.........
where
MonthStart(AddMonths(today(), -1)) = MonthStart(campaign_start_date)
Hi,
Thanks for reply
here campaign starts( campaign_start_date ) every thuesday and end in sunday of each week.
so my previous month will be in 27-06-2016 to 31-07-2016
my current month will be 01-08-2016 to 28-08-2016.
so i wont be able to use MonthStart(AddMonths(today(), -1)) = MonthStart(campaign_start_date).