Click here to Skip to main content
15,888,301 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
m creating a report in SSRS. The report needs to be generated daily. when I run the query in SQL server, it gives me accurate data. However, when the report is generated it gives me data only for the last date of last month. I'm using this to call yesterday/today . I have tried using 1st date of august as start date and September end as end date using the same "getdate" format , and the report runs ok. I am using the same query as the dataset of my report. What am I missing.Thanks so much for your help!!

^^^I'm just baffled that even if I go in and put START DATE as 10/11/16 and END DATE as 10/12/2016 is returns the value of 09/30/2016. If SD is 09/01/16 anD END DATE is 10/12/16 the data for whole of September is returned.No data for October is returned.

SQL
DECLARE @PRD_GRP VARCHAR(3)
DECLARE @START_DATE DATETIME
DECLARE @END_DATE DATETIME
SET @PRD_GRP =  'RDE'
SET @START_DATE = DATEADD(d,-1,GETDATE())'
SET @END_DATE = getdate()


What I have tried:

I tried changing dates( entering it manually & using GETDATA() for various dates).It works for every date, in all format.
When I ask the data for Oct it returns data only for September 30th
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900