Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have the attached script which I'm using to try and create a temporary calendar table that simply holds dates from my vMinDate to my vMaxDate. For some reason the table isn't loading properly and the only result I get is one entry stating '30/12/1899'!
Can anyone see anything glaringly obvious from the code that I'm missing as I can't seem to figure this one out?!
Any help is appreciated,
Thanks,
Samuel
Redefine your variables like:
let vMaxDate= Num(MakeDate(2020, 12, 31));
let vMinDate= Num(MakeDate(2015, 1, 1));
To explain why that is not working:
'31/12/2020' - is actually being expanded (because of $) and generating a number
31 divided by 12 divided by 2020 ->0.0012... // '/' is being considered as numeric operator
And if you apply date(0.0012)- you get the first that of qv calendar system : '30/12/1899'
Dates format is unrecognized, try with
'2020/12/31' and '2015/01/01'
Unfortunately this isn't correcting the issue, I'm rather stumped by this!
what is your dateformat? can you create a texstobject with (date(today()).
Use this Format for your calendar
You have some data format variables at the beginning of the script, does it say this or something else?
SET DateFormat='MM/DD/YYYY';
Redefine your variables like:
let vMaxDate= Num(MakeDate(2020, 12, 31));
let vMinDate= Num(MakeDate(2015, 1, 1));
To explain why that is not working:
'31/12/2020' - is actually being expanded (because of $) and generating a number
31 divided by 12 divided by 2020 ->0.0012... // '/' is being considered as numeric operator
And if you apply date(0.0012)- you get the first that of qv calendar system : '30/12/1899'
the variables needs to be numbers, not strings.
let vMaxDate = Floor(Date#('31/12/2020','DD/MM/YYYY'))
let vMinDate = Floor(Date#('01/01/2015','DD/MM/YYYY'));
or just use
let vMaxDate = Floor(MakeDate(2020,12,31));
let vMinDate = Floor(MakeDate(2015,01,01));
Try this may be:
LET vMaxDate = Date#('31/12/2020', 'DD/MM/YYYY')
LET vMINDate = Date#('01/01/2015', 'DD/MM/YYYY')
Just like to take the opportunity to thank everyone who's contributed, I can only mark a few questions though so please don't get offended if it isn't yours.