I have built a script in which there is one location that requires a date field to be populated. My problem is that I would like to have the date placed automatically and updated each time it ran. I have to run the report for today, tomorrow and the next day. I have to place the date in manually. Is there a way that I can have the date field auto populated?
Here is a partial script that the date is in:
Press Tab * 9
Wait>1.01
Send>090105 'This is the date field I have manually placed
Wait>1.95
Press Tab * 2
...........
........
I found that the field "Date" can be used with a + or - sign. I just don't know how to place the Date so that it will place it correctly at the location. Also I don't know if the Date will be in the format MMDDYY.
Any help will be appreciated.
CEW
.
.
.
Input Date
Moderators: Dorian (MJT support), JRL
To add a day to a date do:
GetDate>date
Add>date,1
This will return tomorrow's date in the system shortdate format. So the format depends on how your system is set up. If you know what this is you could then parse that string to return the format you require. But should the shortdate format change or should this be run on a different computer it will differ.
Therefore a neater approach is to use VBScript as follows:
//Put this VBStart block at start of script
VBSTART
Function DDMMYY
tomorrow = DateAdd("d",1,Date)
DD = Right("0" & Day(tomorrow),2)
MM = Right("0" & Month(tomorrow),2)
YY = Right(Year(tomorrow),2)
DDMMYY = DD & MM & YY
End Function
VBEND
//Then to get tomorrow's date formatted and send it do this:
VBEval>DDMMYY,tomorrow
Send>tomorrow
Adjust the format to suit your needs.
GetDate>date
Add>date,1
This will return tomorrow's date in the system shortdate format. So the format depends on how your system is set up. If you know what this is you could then parse that string to return the format you require. But should the shortdate format change or should this be run on a different computer it will differ.
Therefore a neater approach is to use VBScript as follows:
//Put this VBStart block at start of script
VBSTART
Function DDMMYY
tomorrow = DateAdd("d",1,Date)
DD = Right("0" & Day(tomorrow),2)
MM = Right("0" & Month(tomorrow),2)
YY = Right(Year(tomorrow),2)
DDMMYY = DD & MM & YY
End Function
VBEND
//Then to get tomorrow's date formatted and send it do this:
VBEval>DDMMYY,tomorrow
Send>tomorrow
Adjust the format to suit your needs.
MJT Net Support
[email protected]
[email protected]
Date problem
Thanks, it worked perfectly. I wish I had asked sooner. I would have saved my self many hours. I used the VB script.
Again Thanks
Again Thanks