[Last Call] Learn how to a build a cloud-first strategyRegister Now


Concatenating 4 fields to form a date value using VBScript

Posted on 2012-09-07
Medium Priority
Last Modified: 2012-09-07

I am trying to concatenate 4 fields so that the dates form like this "##/##/####".

This is the current logic that parses correctly but I have some values that have single digits that need to have leading zeros so that it is in the format that I need.

DTSDestination("WAM") = DTSSource("LM_PropSaleMth") & "/" & DTSSource("LM_PropSaleDay") & "/" & DTSSource("LM_PropSaleCentury") & DTSSource("LM_PropSaleYr2Digits")


Question by:Jintonix415
1 Comment
LVL 93

Accepted Solution

Patrick Matthews earned 2000 total points
ID: 38377439
DTSDestination("WAM") = Right("0" & DTSSource("LM_PropSaleMth"), 2) & "/" & _
    Right("0" & DTSSource("LM_PropSaleDay"), 2) & "/" & _
    DTSSource("LM_PropSaleCentury") & DTSSource("LM_PropSaleYr2Digits")

Open in new window


Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month17 days, 17 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question