sorry it seems to have messed up the text...it should be: -
I have a script that loads from a QVD file, but I want to add fields into that table load, using a calcualtion on fields in the QVD.
I have tied the following but the load crashes.
Num((now()-DateRaised),0) as DaysSinceRaised
Can anyone help point me in the right direction? Im very new to load scripts!!
There is a comma missing after DateRaised to separate the fields loaded.
Then, the second argument to Num() function should be a string, representing the format code.
But if you want to truncate the time interval you're calculating to whole days, try using round(), floor() or ceil() function (num will only change the display of the value, not the internal storage).
So maybe like this:
round(now()-DateRaised) as DaysSinceRaised
Num((Now()-DateRaised),'0') as DaysSinceRaised
(or whatever format code is appropriate)
Hope this helps,
Thank you for the function help. I have changed it to
round(now()-DateRaised) as DaysSinceRaised,
round(networkdays(DateRaised,now())) as DaysNetWorkSinceRaised
but it does not reload. it hangs at 01 secs. It it fine if I take out the two function lines!