Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
johngouws
Partner - Specialist
Partner - Specialist

Create an expiry date in a QVW.

I have a working QVW which is to be tested by a Client. I would like to add in functionality to let the model run for a particular duration. Say 30 days. After which it can still be available but I do not want it to reload with NEW data. Existing data can still be shown.

The main tab script is very simple, the standard SETs , then a OLEDB CONNECT string and then the script.

I have a thought of adding something like 'IF( Today() - MakeDate(2013-07-01)) < 30' before the connection string, but cannot get  it to work. I am sure it must be possible!

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='YYYY-MM-DD';
SET TimestampFormat='YYYY-MM-DD h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

IF( Today() - MakeDate(2013-07-01)) < 30 ....

OLEDB CONNECT32 ....


FACT:
LOAD
....
...

Any guide in the correct direction will be appreciated.

Thanks

John


1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     End if is necessory, sometimes it will through an error.

     And if you want to retain the older data, you can try incremental load.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You are on a correct path,

     you can first check the date and depending on that you can reload the data.

     you can write the condition like this.

     if today() <= (makedate(2013,01,01) + 30) then

     .......

     End if

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
johngouws
Partner - Specialist
Partner - Specialist
Author

Hello Kaushik. Thanks for the prompt reply.

I modified my script to read as below. It works like a charm, although I would have liked to retain the existing data. I think that is just the nature of a reload.

I also see it does not make a difference if I have the End If at the end or not.

if today() <= (makedate(2013,08,01) + 30) then

     OLEDB CONNECT32

     script ..

End If

Thanks,

John

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     End if is necessory, sometimes it will through an error.

     And if you want to retain the older data, you can try incremental load.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!