Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 ALTER TABLE and SEPARATE DATA SQL STATEMENTS

Author  Topic 

StarScream
Starting Member

1 Post

Posted - 2005-06-07 : 21:04:28
Helo…please really need your help.

I designed a small desktop database to automatically import some Log files. A sample of a transmit log file (emails sent from our rural email stations) looks like this when imported in access.

Date Time Direction Sender MessageID
03062005 133501 To Internet emailX@ab.com Blablabla
03062005 125001 To Internet emailQ@ab.com Blablabla
03062005 125001 To Internet emailZ@ab.com Blablabla
03062005 125001 To Internet emailA@ab.com Blablabla

I would like to be able to query all emails sent between one date and another. However, the date here is recorded has a string or text. I would like to automatically add a field with the date as Date/Time datatype in the Table. I think I should be able to do this with a few SQL statement like ALTER TABLE myTable ADD COLUMN NewDate AS datetime…and then another SQL statement to separate data and put it into this new field.

Then I could query for BETWEEN Date1 and Date 2 easily.

I’m pretty close but been trying for a while now and always error messages as results. I think I really NEED help this time.

Thank you,

Ghislain Bob Hachey

SMerrill
Posting Yak Master

206 Posts

Posted - 2005-08-10 : 21:25:25
quote:
... look like this when imported into access.

When you get to the Import Text Wizard screen, there is an ADVANCED button in the lower-left. This will bring up an Import Specification dialog, in which you can set the date to MDY and check 4-digit years for that column. Save the Import Text specification to re-use when you import these kinds of files.

~ Shaun Merrill
Seattle, WA
Go to Top of Page
   

- Advertisement -