By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,849 Members | 2,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,849 IT Pros & Developers. It's quick & easy.

Trouble with Dates - Please Help

P: n/a
Hello,

I am having alot of trouble reading in a date values from a text file
which is exported from another application.

My program is pretty basic, I read in values from a plain text file
which had comma seperated values. I use the input statement to read
the values from the file. eg. Input #1, name, dte1, tme1

The text file conists of lines like;

1.167,08/07/2006,02:16:56.2

If I have my variables defined as strings, name and tme1 read in fine,
the date (dte1) reads in as "8".

I have tried changing the data type of dte1 to date and variant, but
still no luck.

If the values in the text file have a "" around them the program works
fine. But the text file is output from a proprietry piece of software
which i can't change.

Any help or tips will be appreciated.

thanks

Peter

Nov 25 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Peter" <px*******@gmail.comwrote in message
<11*********************@h54g2000cwb.googlegroups. com>:
Hello,

I am having alot of trouble reading in a date values from a text file
which is exported from another application.

My program is pretty basic, I read in values from a plain text file
which had comma seperated values. I use the input statement to read
the values from the file. eg. Input #1, name, dte1, tme1

The text file conists of lines like;

1.167,08/07/2006,02:16:56.2

If I have my variables defined as strings, name and tme1 read in
fine, the date (dte1) reads in as "8".

I have tried changing the data type of dte1 to date and variant, but
still no luck.

If the values in the text file have a "" around them the program
works fine. But the text file is output from a proprietry piece of
software which i can't change.

Any help or tips will be appreciated.

thanks

Peter
I don't know what the problem might be, but have you tried reading the
whole line, and manipulate it after rading it?

Line Input #1, strTextLine
Debug.Print strTextLine

If it works, you could for instance try the Split() function, or other
text manipulation functions to separate into different variables

--
Roy-Vidar
Nov 25 '06 #2

P: n/a
Peter
Read the line in as suggested. Programatically add a pound sign "#" after
the first comma and before the second comma. You will end up with
"1.167,#08/07/2006#,02:16:56.2".
Access will then easily treat the "#08/07/2006#" as a date.

"Peter" <px*******@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
Hello,

I am having alot of trouble reading in a date values from a text file
which is exported from another application.

My program is pretty basic, I read in values from a plain text file
which had comma seperated values. I use the input statement to read
the values from the file. eg. Input #1, name, dte1, tme1

The text file conists of lines like;

1.167,08/07/2006,02:16:56.2

If I have my variables defined as strings, name and tme1 read in fine,
the date (dte1) reads in as "8".

I have tried changing the data type of dte1 to date and variant, but
still no luck.

If the values in the text file have a "" around them the program works
fine. But the text file is output from a proprietry piece of software
which i can't change.

Any help or tips will be appreciated.

thanks

Peter

Nov 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.