Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

date in a script

How can I get a formated date (DD/MM/YY) using VB Script?

1 Solution

Accepted Solutions
Not applicable

Hello

attached is the application i tried and it is working for me,please have a look and let me know

Talha

View solution in original post

5 Replies
Not applicable

suppose you have the date and time in this format

20050718095318.019149-420 then you can use the below code to convert into

7/18/2005 9:53:18 AM

CDate(Mid(dtmStart, 5, 2) & "/" & _
Mid(dtmStart, 7, 2) & "/" & Left(dtmStart, 4) _
& " " & Mid (dtmStart, 9, 2) & ":" & _
Mid(dtmStart, 11, 2) & ":" & Mid(dtmStart, _
13, 2))

Hope this helps

Talha

rcandeo
Creator III
Creator III
Author

Look my script, it didn't work:

ActiveDocument.GetVariable("Date").setContent ActiveDocument.Evaluate("today()"),false

ActiveDocument.GetField("Payment_Date").Select ActiveDocument.Evaluate(Mid(Date,1,6)&Mid(Date,9,2))



The result of the Date variable is 07/08/2009

I need Payment_Date field to stay like this: 07/08/09 but is not working

Not applicable

Hello

attached is the application i tried and it is working for me,please have a look and let me know

Talha

rcandeo
Creator III
Creator III
Author

it worked, thank you

rcandeo
Creator III
Creator III
Author

it worked. Thank you very much.