Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to store QVDs on a weekly basis of some data read in from an Excel file.
Somehow I also need to stamp each one with a date field, and also incorporate that date in the qvd file name.
Can anyone tell me how I can include it in the filename?
The LOAD statement will obviously contain the date field Now().
also, is there a way of instead of creating a date field in the table, to have a counter? like a filenumber, which increments each time the qvd is stored?
Sorry, a few things in one there..
thanks in advance,
Matt
For storing the QVD Files, use a variable in the following way:
Let V=Date(Today(),'YYYYMMDD');
.
.
.
Store TableX into TableX_$(V).qvd;
You can use the variable to keep the sequence number if you want to use it instead of the dates.
Thanks for the response, I can get that working now.
I would, howver still like to know, if there is a clever solution out there for maybe sequentially numbering each qvd rather than timestamping it.
Can anybody think of any clever ways to do this - I am stumped..
Thanks in advance,
Matt
You could have a variable that is set first time when the application is reloaded and after that increased by 1 every reload. Use that variable at the beggining of the file name.
if isnull(counter) or len(counter)=0 then
set counter = 1;
end if
store tmp into $(counter)_history.qvd;
when loading history data you can that itterate i from 1 to counter and load like this:
concatenate(history)
load *, '$(i)' as historyID
from [$(counter)_history.qvd] (qvd);
Hi Matt,
What i have shown is the way to control the name of QVD Files using variables. Instead of storing TimeStamp, you could assign a number to the variable, and that should be sufficient for sequentially numbering your files.