472,969 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,969 software developers and data experts.

Date and time format conversion problem (not the usual)

My DB is Access 2000 based "possibly written in 2002" and I have to send and
receive update files, ported to a UNIX server by FTP, DB unknown.
The file content uses a fixed length string, zero filled left.
ie;

001332001695001995040601040630

where,
001332,001695,001995,040601,040630

Filename: Newprice.txt - detail record

Field Name
Data Type
Description

OLCC Item Code
Numeric(6,0)
Zero filled to the left.

New Price
Numeric(6,2)
Old Price
Numeric(6,2)
Start Date
Numeric(6,0)
Format YYYYMMDD. Beginning date when new price takes effect.

End Date
Numeric(6,0)
Format YYYYMMDD. Last date when new price no longer applies.

My problem is that Microsoft DB format does not accept dates without
delimiters ie; / / or , , or _ _
The same goes for a similar time format in another file where time is hhmm
as opposed to MS hh:mm
How can I convert or get Access to import and export this format.

ie: yymmdd=040520=04/05/20
and 04/05/20=040520

I have to go both ways.

I hope I have provided enough information and appreciate any help you can
provide.

Bruce "Luckydog"
Nov 12 '05 #1
1 3376
Hi Bruce.

Parse the text field with Mid(), and generate the dates with DateSerial()

If the text field is called "d", and contains strings of numbers
representing yymmdd, this example pulls out the 2nd date:
DateSerial(Mid([d], 7, 2), Mid([d], 9, 2), Mid([d], 11, 2))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bruce Cushman" <cu*****@hevanet.com> wrote in message
news:20*******************@news.newsreader.com...
My DB is Access 2000 based "possibly written in 2002" and I have to send and receive update files, ported to a UNIX server by FTP, DB unknown.
The file content uses a fixed length string, zero filled left.
ie;

001332001695001995040601040630

where,
001332,001695,001995,040601,040630

Filename: Newprice.txt - detail record

Field Name
Data Type
Description

OLCC Item Code
Numeric(6,0)
Zero filled to the left.

New Price
Numeric(6,2)
Old Price
Numeric(6,2)
Start Date
Numeric(6,0)
Format YYYYMMDD. Beginning date when new price takes effect.

End Date
Numeric(6,0)
Format YYYYMMDD. Last date when new price no longer applies.

My problem is that Microsoft DB format does not accept dates without
delimiters ie; / / or , , or _ _
The same goes for a similar time format in another file where time is hhmm
as opposed to MS hh:mm
How can I convert or get Access to import and export this format.

ie: yymmdd=040520=04/05/20
and 04/05/20=040520

I have to go both ways.

I hope I have provided enough information and appreciate any help you can
provide.

Bruce "Luckydog"

Nov 12 '05 #2

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

Similar topics

3
by: praba kar | last post by:
Dear All, I have doubt regarding date string to time conversion function. In Python I cannot find flexible date string conversion function like php strtotime. I try to use following type...
7
by: Niall Porter | last post by:
Hi all, I'm building an ASP app on a Windows 2000/IIS machine which interfaces with our SQL Server 2000 database via OLE DB. Since we're based in the UK I want the users to be able to type in...
7
by: Edward Mitchell | last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a format of Time. The controls are all embedded in dialogs. I created the controls by dragging the DateTime picker from...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
50
by: z. f. | last post by:
HI, i have string in format dd/mm/yyyyy hh:mm:ss and giving this as an input to DateTime.Parse gives a string was not recognized as a valid date time format string error. how do i make the parse...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
7
by: bruce.dodds | last post by:
Access seems to be handling a date string conversion inconsistently in an append query. The query converts a YYYYMM string into a date, using the following function: CDate(Right(,2) & "/1/" &...
2
by: RN1 | last post by:
A TextBox displays the current date (in dd/mm/yyyy format) & time when a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the date into international format so that the remote server...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.