English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am facing a problem in generating a query which is like this..

IN a given table, two columns having two different dates like One starting of project, and the second is ending of project.. Now i wish to generate a query with the days available for any project completion.

ex : startdate : Jan 1, 2007 enddate : June 16,2007

Now in the query .. what i need to do to get the difference between End date and startdate. I need to repeat the same for ten projects which is all given in single table.


Thanks for your efforts

2007-12-02 14:09:21 · 3 answers · asked by Digitalphotographer80 1 in Computers & Internet Software

Dear All,
Thanks for reply.

What is syntax of using Datediff Function? I got it but not able to use it..I am having two columns like StDate & EndDate. I created a new column DaysLeft . so now please guide what should I do next.

I need it in MS Access,not in excel.

2007-12-02 14:28:12 · update #1

3 answers

It is easy. You just subtract them and express the answer as a number.

I ran a quick EXCEL test where I put a date (in date format) in A1 and a different date (in date format) in B1. Then I put "=A1-b1" in C1 (which was in general number format). If you want to do the whole bunch just copy the equation for each pair of the ten.

2007-12-02 14:17:42 · answer #1 · answered by Rich Z 7 · 0 0

this might help that

SELECT (Column name)
FROM (Table name)
WHERE BETWEEN startdate jan 1,2007 AND enddate june 16,2007

this would solve ur problem

gud luck

2007-12-02 14:18:26 · answer #2 · answered by sun 2 · 0 0

Oh, lucky for you the function is named exactly as it is in MySQL. The function you're after is probably DATEDIFF()

2007-12-02 14:16:32 · answer #3 · answered by Adam 3 · 0 0

fedest.com, questions and answers