--- pharm_dog wrote: > How does this function work? I am trying to create a macro where I > enter the previous days date in a field in order to get a report. > Can I use this function for this?
This function will not help you with what you want to achieve. What you are after is the AddDays service of the Date plugin, which if you feed it this: Date.AddDays(Date, -1) Will return yesterday's date in this format: 20041110 If you want to change that format then you will want to do something like this: ; I want the format to be 10/11/2004 ; Get yesterday's date into a variable Local Yesterday = Date.AddDays(Date, -1) ; Get the year (characters 1 to 4 of Yesterday) into a variable Local Year = Select(Yesterday, 1, 4) ; Get the month into a variable Local Month = Select(Yesterday, 5, 6) ; Get the day into a variable Local Day = Select(Yesterday, 7, 8) ; And now I'll arrange them how I want into one more variable Local Formatted = Day ++ ?"/" ++ Month ++ ?"/" ++ Year ; And this command will type that formatted output Win.Keys(Formatted) Save the above lines into a script, e.g. TypeYesterday.PowerPro, and then set your macro to run this command: .TypeYesterday -- Alex Peters / Melbourne, Australia PowerPro v4.1.00 / Windows XP > Attention: PowerPro's Web site has moved: http://www.ppro.org > Yahoo! Groups Links (PPTL) ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/JV_rlB/TM --------------------------------------------------------------------~-> Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
