Solved

Date type field

Posted on 2004-08-25
6
168 Views
Last Modified: 2010-04-23
I am currently reading a .txt file in a data stream.  One of the fields is a date field.  In the file the date looks like

0504

This would indicate May of 2004.  How should I format this field in my Dimension statement?  How would I end of with a value of 05/??/2004.

Thanks
Kenny
0
Comment
Question by:kwh3856
  • 4
  • 2
6 Comments
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11895090
Keep it string type. Then use string methods to make it.. say first day of that month.
0
 

Author Comment

by:kwh3856
ID: 11895113
Once I have converted it to a string and parse it out to how I need it, how do I then save it back out as a date string or is there any conversion that needs to be done?

Thanks
Kenny
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11895124
Dim DateString As String
DateString = "... get the data in it (0504)
'Format the string
DateString = DateString.SubString(0,2) & "/01/20" & DateString.SubString(2)
-Baan
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 11895137
Now the DateString is in the format "05/01/2004".. now you can parse it to Date type...
0
 

Author Comment

by:kwh3856
ID: 11895185
Thanks
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11895227
you are welcome... :))
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now