Date conversion

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
wilfredtr
Newbie
Posts: 16
Joined: Thu Aug 14, 2003 3:59 pm
Contact:

Date conversion

Post by wilfredtr » Thu Feb 05, 2004 9:05 pm

OK - I have a date in an Excel spreadsheet 01/01/04 that I need to copy and paste into another program as 010104. I'm stumbling over the code. I want to copy it to clipboard, convert it and paste.

Ctrl-C yada yada yada
GCB>DATE
Let>NEWDATE=A
Mid>DATE,1,2,MTH
Mid>DATE,4,2,DAY
Mid>DATE,6,2,YER
Concat>MTH,DAY,YER


This doesn't seem to work.

Help! -Wilfred

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Feb 05, 2004 10:09 pm

Hi,

Concat only accepts two parms. Instead do this:

Ctrl-C yada yada yada
GCB>DATE
Let>NEWDATE=A
Mid>DATE,1,2,MTH
Mid>DATE,4,2,DAY
Mid>DATE,6,2,YER
Let>DATE=%MTH%%DAY%%YER%

DATE is now in the format you want it.
MJT Net Support
[email protected]

wilfredtr
Newbie
Posts: 16
Joined: Thu Aug 14, 2003 3:59 pm
Contact:

Post by wilfredtr » Fri Feb 06, 2004 12:46 am

I tried it and it didn't seem to work. Here is my latest (non-working) version.


GCB>THEDATE
Send>THEDATE ( Just to see if its in windows clipboard)
MidStr>THEDATE,1,2,THEMTH
Send>THEMTH
MidStr>THEDATE,4,2,THEDAY
Send>THEDAY
MidStr>THEDATE,6,2,THEYER
Send>THEYER
MidStr>Date Happy Birthday,1,5,somevalue
Send>somevalue


I end up with:

01/01/04THEMTHTHEDAYTHEYEARDate H

agh!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Feb 06, 2004 3:09 am

I have no time to do real tests right now, but noticed the end of your results ......Date H is the result of your last MidStr> command:
MidStr>Date Happy Birthday,1,5,somevalue
=====================================
A few things come to mind right away that you can do to help yourself.

1. Make sure you do not have any trailing spaces on any lines.

2. When you are Sending on every line you are just appending to the cursor position. Try using MessageModal> vs. Send> to validate the contents real time, or open the Watch List in the editor and Single Step through the lines to see the results. I recommend using the Single Step approach with the Watch List opened up.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts