Is your WHERE condition defined at the Object level ? If yes, then the WHERE clause is the problem. As a best practice you should not use WHERE clause in the definition of an Object. You could re-write the same using CASE WHEN THEN ELSE END statement.
thanks, I changed to CASE WHEN, but it is not giving the requried output
as comparing with getdate() and timedate ( fiscal date calendar), it is returning current month only for the query result with timedate = getdate for all others it blank.
since getdate() function is with the time, I am truncating to match with timedate column
CASE when convert(varchar(8,timedate,112) =convert(varchar(8,getdate(),112) Then Timemonth END
query is doing the comparison for each record so when the transaction date is not equal to getdate() it is not returning the timemonth value otherwise it is blank. Case is working correct but I need ‘Current month’ as stand alone value to use in filter.
By adding convert(varchar(8,timedate,112) =convert(varchar(8,getdate(),112) in filter will only return records with transaction on getdate(). But I need pending sales less than current month.
example - 2013 06 - current month, I need pending sales from 2013 01 - 2013 05.
since all the transaction need to be grouped monthly I need to identify current month.