Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have created two variables vStartDate and vEndDate and in the application i created a input box for both, so the user will enter Start Date and End Date.
I want to create a field called "Date' using the user entered start date and end date.
Eg. vStartDate=02/01/2011
vEndDate = 02/28/2011
so the Date field should be - 02/01/2011, 02/01/2011, . . . . . . . . , 02/28/2011.
Is it possible to have such scenario.?
Ranjit
You used lowercase 'mm/dd'. Those should be upper case because 'mm' is for minutes, not months. More generally, I would just set my DateFormat correctly so that I didn't have to individually format every date in the script.
SET DateFormat='MM/DD/YYYY';
If you always want to start with today, don't bother with a variable for it. Just use today() in the script. (Edit: Same if you're using a formula for the end date variable. Just put that formula in the script instead of using a variable.)
[Dates]:
LOAD date(today()+recno()-1) as Date
AUTOGENERATE $(vEndDate)-today()+1;
Hello Ranjit,
You may try something like Date = vStartDate(GetSelectedValue), vEndDate(GetSelectedValue). Just a try, can u please let me know if that worked?
ANDY
You'd need to reload, of course, but this should do it.
[Dates]:
LOAD date($(vStartDate)+recno()-1) as Date
AUTOGENERATE $(vEndDate)-$(vStartDate)+1;
Hi John,
I have attached a file and i did like you said, but i am getting different dates.
Also, it gives an error message, when i use =today() in my vStartDate. How will i overcome this error and get correct dates.
My vEndDate also i have to type a formula to get my end date, does this autogenerate if i use formula instead of numbers in Variables.?
I am very thankful if you could solve this issue.
Ranjit
Hi john,
please see my thread. please find the attachment.
Thanks
You used lowercase 'mm/dd'. Those should be upper case because 'mm' is for minutes, not months. More generally, I would just set my DateFormat correctly so that I didn't have to individually format every date in the script.
SET DateFormat='MM/DD/YYYY';
If you always want to start with today, don't bother with a variable for it. Just use today() in the script. (Edit: Same if you're using a formula for the end date variable. Just put that formula in the script instead of using a variable.)
[Dates]:
LOAD date(today()+recno()-1) as Date
AUTOGENERATE $(vEndDate)-today()+1;
Hey John,
From your answer i got lot of ideas how to autogenerate dates through different variables. I got my answer. Thanks a lot. 🙂
Ranjit