brazilhills
IS-IT--Management
I want to be able to set my Crystal Report to run daily report from Business Objects Server. In order to do this I want to set the "datetime" field to be in the period of CurrentDate - 1.
The date in the database is char(12) in this format YYYYMMDDhhmm. If I use the function below to convert the char(12) to DateTimeValue then my report is EXTREMELY inefficient.
How can I set my report to run for yesterday's date every time without having to do this conversion which taxes the database?
Here is what I'm using which is inefficient:
numbervar years:= ToNumber(mid({hst.exitdate},1,4));
numbervar months:=ToNumber(mid({hst.exitdate},5,2));
numbervar days:=ToNumber(mid({hst.exitdate},7,2));
numbervar hours:=ToNumber(mid({hst.exitdate},9,2));
numbervar mins:=ToNumber(mid({hst.exitdate},11,2));
numbervar secs:=00;
DateTimeValue(years,months,days,hours,mins,secs)
The date in the database is char(12) in this format YYYYMMDDhhmm. If I use the function below to convert the char(12) to DateTimeValue then my report is EXTREMELY inefficient.
How can I set my report to run for yesterday's date every time without having to do this conversion which taxes the database?
Here is what I'm using which is inefficient:
numbervar years:= ToNumber(mid({hst.exitdate},1,4));
numbervar months:=ToNumber(mid({hst.exitdate},5,2));
numbervar days:=ToNumber(mid({hst.exitdate},7,2));
numbervar hours:=ToNumber(mid({hst.exitdate},9,2));
numbervar mins:=ToNumber(mid({hst.exitdate},11,2));
numbervar secs:=00;
DateTimeValue(years,months,days,hours,mins,secs)