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
 General SQL Server Forums
 New to SQL Server Programming
 DATEDIFF within tables

Author  Topic 

raaams
Starting Member

2 Posts

Posted - 2008-06-14 : 15:45:14
Guys,
I am not an expert in access or SQL. I have a simple Fn. to be executed. I would like to use DATEDIFF fn. in access 2007 for calculating the number of days between current date and a given date within a table.Please help me.

Please tell me how to use DATEDIFF for doing this?


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-14 : 16:35:54
What does the help file tell you?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

raaams
Starting Member

2 Posts

Posted - 2008-06-15 : 00:58:50
quote:
Originally posted by Peso

What does the help file tell you?



E 12°55'05.25"
N 56°04'39.16"





Peter,

Thanks. I am not able to execute the function as specified in the help file. It tells about the function and not the way to execute in the table of an access file. I can understand the function how it works but i am not able to exceute it.

please help me
Regards,
Rams
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-15 : 02:04:14
select col1, datediff(day, col2, getdate())
from table1



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-15 : 03:14:19
http://www.techonthenet.com/access/functions/date/datediff.php
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-15 : 09:39:27
Oh... How DATEDIFF work?
http://www.sqlteam.com/article/datediff-function-demystified



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-15 : 10:00:39
quote:
Originally posted by Peso

Oh... How DATEDIFF work?
http://www.sqlteam.com/article/datediff-function-demystified



E 12°55'05.25"
N 56°04'39.16"



Nicely explained article
Go to Top of Page
   

- Advertisement -