?
Solved

Date type field

Posted on 2004-08-25
6
Medium Priority
?
180 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses

840 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