Question : How do I have a dynamic date on a report when an SQL view changes?

Hi,

We run a report based on date

I have an instruction report in Crystal that is printed sometimes 7 days in advance. I have a database where the report collects it's information based on that schedule;

Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday and Friday. Each of these days has a 1 or a 0 in the record to tell it that it is to be printed on 'these' days.

My MSSQL view code (attached) can push the date out for as many days as I would like which is fine and it picks up the data correctly but the problem I have is that I need to print on the instruction report the DATE corresponding to the date the report is for.

So, if I select GETDATE in the SQL view with +1 I get the next days schedule but on the report I need to show the next days date on it.

Does anyone know how to 'connect' these two?

Any help would be much appreciated.

Regards,

Ken
1:
2:
3:
4:
5:
6:
SELECT     countryCode, cityCode, itemCode, storeType, vendorCode, gridCodeX, gridCodeY, facings, brand, rc, storeCode, storeName, Monday, Saturday, Sunday, Tuesday, 
                      Wednesday, Thursday, Friday, ARABIC, ItemName, upcCode, TREF
FROM         dbo.ScheduleView
WHERE     (CASE DATEPART(weekday, GETDATE() + 4) 
                      WHEN 1 THEN [Sunday] WHEN 2 THEN [Monday] WHEN 3 THEN [Tuesday] WHEN 4 THEN [Wednesday] WHEN 5 THEN [Thursday] WHEN 6 THEN [Friday] WHEN 7 THEN
                       [Saturday] END = 1)

Answer : How do I have a dynamic date on a report when an SQL view changes?

>do I need to change that now?
yes, you have to attach it to the second bit of code, making that +1 a crystal report prompt parameter ...
Random Solutions  
 
programming4us programming4us