Adding Days to a Date

T

tim

I get a text file and link it to a Access table. I then transfer it to
another table with a text field that is a date and data is in this format:
091105. I run a query to add forward slashes:



Left$([date],2) & "/" & Mid$([date],3,2) & "/" & Right$([date],2)



The problem is I need to add 10 days to this date to be used in a merge
document. The only way I am able to do this is to change the field type to
date/time after I transfer the data and run the above-mentioned query. I
have tried changing the field type to date/time before the transfer and it
does not work. Below is part of the query I use to add 10 days to the date.



[date]+10 AS grcExpDate



What am I doing wrong?

Any help would appreciated.



Tim

Access 2000
 
P

Pat Hartman\(MVP\)

If you use the TransferText Method/Action, you can use an import spec. The
import spec can translate the non-standard date field on input so that it is
imported as a date/time data type. To create the import spec, you must
import the file ONCE manually and save the spec. Once that is done, you can
refer to the spec any time you need to import that same file again.

BTW - Date is a poor choice as a name since it is the name of a function and
as such can lead to confusion in oh so many ways. Avoid function and
property names as well as special characters and embedded spaces.
 
D

Duane Hookom

Try
CDate(Left$([date],2) & "/" & Mid$([date],3,2) & "/" & Right$([date],2)) +
10 as grcExpDate
 
T

tim

That works!

Thank you
Tim


Duane Hookom said:
Try
CDate(Left$([date],2) & "/" & Mid$([date],3,2) & "/" & Right$([date],2)) +
10 as grcExpDate

--
Duane Hookom
MS Access MVP
--

tim said:
I get a text file and link it to a Access table. I then transfer it to
another table with a text field that is a date and data is in this format:
091105. I run a query to add forward slashes:



Left$([date],2) & "/" & Mid$([date],3,2) & "/" & Right$([date],2)



The problem is I need to add 10 days to this date to be used in a merge
document. The only way I am able to do this is to change the field type to
date/time after I transfer the data and run the above-mentioned query. I
have tried changing the field type to date/time before the transfer and it
does not work. Below is part of the query I use to add 10 days to the
date.



[date]+10 AS grcExpDate



What am I doing wrong?

Any help would appreciated.



Tim

Access 2000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dcount returning no results!!! 0
Transfer Text 9
Date calculation on 2 fields 5
#error - Blank 3
query on date 1
Help with 3 scenerio query 1
Between Dates Parameter Query 13
Combine Duplicates in Query 0

Top