Age calculation

G

Greg Snidow

Hello everyone. I had the following DateDiff work fine in MDB
=DateDiff("d",[Invoice Date],Date()).

Does anyone know how to write the code for the same thing in ADP? I need to
do the above, which calculates the age of an invoice. I also need to be able
to calculate the difference in days between two dates of smalldatetime
format. Thank you in advance for any help.
 
D

David Portas

Greg Snidow said:
Hello everyone. I had the following DateDiff work fine in MDB
=DateDiff("d",[Invoice Date],Date()).

Does anyone know how to write the code for the same thing in ADP? I need
to
do the above, which calculates the age of an invoice. I also need to be
able
to calculate the difference in days between two dates of smalldatetime
format. Thank you in advance for any help.

Like this:

DATEDIFF(D,[Invoice Date],CURRENT_TIMESTAMP)

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
 

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

Top