Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dodgy date formatting ew
Message
De
29/12/1999 10:08:11
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00309787
Message ID:
00309831
Vues:
30
>I am selecting some data and copying it to the clipboard. Then pasting it into Excel - but when it is pasted the date format gets jumbled. From 01/02/1999 to 02/01/1999 for the first 12 days of the month until the day has to be the first part.
>
>The DATE is set to BRITISH and appears fine in VFP but not in Excel
>
>I have tried to format the cells that are being pasted into before and after I haver pasted in the data - this hasn't helped either.
>
>I have tried to re-format in excel but with no luck. Why do the Americans have to have such a weird date system!!!!
>
>SELECT * FROM importsts WHERE MONTH(gmt_date) = nmonth INTO CURSOR pastetoexcel && Select one months HH data into a cursor.
>SELECT pastetoexcel && Select the cursor holding the years HH data.
>GO TOP && Need to go top becausedatatoclip works from the record pointer onwards
>_VFP.DATATOCLIP(,,3) &&Copy data to clipboard - records delimited by tabs - 3 passed as parameter
>ox.application.worksheets(1).cells(npushrow,2).pastespecial && Paste the data into Excel
>
>
>
>ox.RANGE(ox.cells(12,4),ox.cells(25,4)).NumberFormat = "DD/MM/YYYY"

You could set date to american just before doing the query. Then the formatting should work (assuming that is the correct syntax for excel).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform