subtract 2 date coulmn into query

BrOkEn_iCe

Registered User.
Local time
Today, 08:43
Joined
May 20, 2008
Messages
18
subtract 2 date coulmn into query ,how?

hi all
i try many wayes to subtract a 2 dates coulmn in a query and i failed

i want to subtract start_dates coulmn and end_dates coulmn to get the number of dayes between them how i can do this
 
Last edited:
in query it return this error

invalid syntex

i use this code

exp2:DateDiff ("yyyy", #15/10/1998#, #22/11/2003#)
 
Thats not true

Create another column and call it

difference: DateDiff("d",[Start_date],[end_date])
 
i try it several tim and it keep tilling me invalid syntex
you enter in vailed character or comma why that i don't know
 
Can you post exactly what you are trying? Are your start_dates and end_dates stored as dates?
 
Post number 6's solution works fine.

difference: DateDiff("d",[Start_date],[end_date])

Rainman is exactly right. Copy the text above into a new column after end_date in your query design and it will work fine.
 
To answer your question in post 7 - the "d" tells the datediff function that you want the result displayed in days. If you were to put "yyyy" in there it would return the number of years between the two dates.

Have a look at the help file, it will explain everything.
 
i am trying this code many times and it keep tilling me
" invalid syntex
you enter in vailed character or comma why that i don't know"
 
Sorry my friend, you must be entering it wrong. I downloaded your DB, put it in your query and it works 100%.

Have a look at the query in your DB, I've done it and attached it for you. I copied Rainman's query text straight into your DB and it works fine.
 
Last edited:
thx i know what i am doing wrong i writ a (,) and it must be (;)

have a good day have a good luck and thx one more time
 
Last edited by a moderator:
Other way round chap but glad it works OK
 

Users who are viewing this thread

Back
Top Bottom