473,467 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

fun, but hopefully easy question

Okay, I am grabbing data from a dinosaur, an AS400 system. One of the date
fields is formated as decimal so the data adapter is filling the data set
with these decimal numbers (ie 712004 for today or 10102001 for October 10,
2001).

Being fairly new with .net, is there an easy way to covert these decimal
values into a usable date for vb?

Thanks for the information.

Brad
Nov 20 '05 #1
1 1062
Here's 2 functions I write long ago in the asp days that will do the
trick....they may need a little tweaking to work with .net... Believe it
or not we still use our 400 to run MAPICS. LOL

private function ConvertDate(inDate)
' Converts the stupid AS400 date into a normal date field
dim StrMonth, strDay, strYear
if len(indate) = 6 then inDate = "0" & inDate
strYear = 1900+left(inDate, 3)
strMonth = mid(inDate,4,2)
strDay = right(inDate, 2)
ConvertDate = strMonth & "/" & strDay & "/" & strYear
end function

Private function ConvertDate400(inDate)
' Converts a normal date field into a stupid AS400 Mapics date
dim StrMonth, strDay, strYear
strMonth = month(inDate)
if len(strMonth)=1 then strMonth = "0" & strMonth
strDay = day(inDate)
if len(strDay)=1 then strDay = "0" & strDay
strYear = year(inDate)-1900
ConvertDate400=strYear & strMonth & strDay
end function

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
Okay, I am grabbing data from a dinosaur, an AS400 system. One of the date fields is formated as decimal so the data adapter is filling the data set
with these decimal numbers (ie 712004 for today or 10102001 for October 10, 2001).

Being fairly new with .net, is there an easy way to covert these decimal
values into a usable date for vb?

Thanks for the information.

Brad

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bonj | last post by:
I have got the starting bits of a game that I am trying to write. I did start to write it in VC++6, but found the basic windows GDI to be of general poor performance for animation. So I decided to...
5
by: LedZep | last post by:
What up, All I need to do is enter a last name in a text box, query a MSAccess database and display the name with the corresponding columns. This is no problem, but when there are more than one...
4
by: Brian Henry | last post by:
I have a listbox, and i need to show a text string for selection, but each item is tied to a number (not visible) i need to select the visible text and have it return the number value, i know its...
13
by: Ghislain Tanguay | last post by:
I have a compiled vb.net app and I want to give the user a choice to launch it from the start line command and pass it a parameter or not. How can I do that in my code? Is it possible? Ex. :...
1
by: melanieab | last post by:
Hi, If there's a textbox and the text entered is longer than what's visible (the textbox length), how do you make it so that the beginning chunk of text is visible (instead of the last part of...
5
by: Byron | last post by:
I need to create an application that uses primarily a single form rather than an SDI that creates a new form for everythting. However, I don't want an MDI style application since the users I'm...
3
by: Gus Gassmann | last post by:
Hi all: I've been working with XML schemas for about a year now, strictly monkey-see-monkey-do so far. (For instance, I did not know about namespaces until yesterday.) My access to the internet...
1
by: Erik | last post by:
Hi Everyone, Hopefully this is an easy one. I've googled around for the answer but cant find it. I have simple login page that authenticates via a web service. I am using a custom membership...
1
by: Andrew | last post by:
I'm learning PHP so this might be a simple question to more expeienced developers hopefully. I have a findrecords.php page which has the following code which creates a new record in a database...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.