Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

VbScript is not returning correct Date format

Interesting situation here
My VbScript is pulling these two columns (I eliminated others for this demo)  and placing them in a text file.

 the date in the CSV says 06/20/2011 yet its pulled to the text file as 6/20/2011..  
I need the proper MM/DD/YYYY to be transferred to the text file

Thanks in advance
Code Attached

can be execute by command

cscript Script.vbs sample.csv 1.txt




sample.csv
Script.vbs
1.txt
0
plusone3055
Asked:
plusone3055
  • 2
1 Solution
 
hieloCommented:
on line 34 of Script.vbs, try:
objRecordset.Open " SELECT ACT_ID, FORMAT([INTRO_CID_ISSUE_DATE],'mm/dd/yyyy') as [INTRO_CID_ISSUE_DATE] FROM " & objFile.Name, objConnection

Open in new window

0
 
Martin LissOlder than dirtCommented:
Use Filedate = Format(CSVDate, "mm/dd/yyyy")
0
 
plusone3055Author Commented:
martinLiss
where should i insert that what line ?
0
 
plusone3055Author Commented:
PERFECT :)
thank you much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now