Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2008

Tip: Looking for answers? Try searching our database.

DateDiff

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andre Adams - 28 May 2008 15:16 GMT
Hello all,

How would I run a query that would give me the total days in between the
original date and the current date?  The only date that I have in the
database is the original date.  How would I tell access to subtract that from
the current date to come up with the number of days in between?
Douglas J. Steele - 28 May 2008 15:54 GMT
DateDiff("d", [OriginalDate], Date())

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hello all,
>
[quoted text clipped - 3 lines]
> from
> the current date to come up with the number of days in between?
Andre Adams - 28 May 2008 16:58 GMT
Thank you very much!  Perfect!

> DateDiff("d", [OriginalDate], Date())
>
[quoted text clipped - 5 lines]
> > from
> > the current date to come up with the number of days in between?
Andre Adams - 28 May 2008 17:22 GMT
Sorry.  Me again.  I was wondering.  Because I'm doing this query to run from
the last settlement date, I only need the last transaction on the books for
each Manager.  So Broker X might have last traded on 04/30/2008 and Broker Y
might have last traded on 05/15/2008.  Those are the dates that I need the
database to calculate from.  Is there a way?

> DateDiff("d", [OriginalDate], Date())
>
[quoted text clipped - 5 lines]
> > from
> > the current date to come up with the number of days in between?
Douglas J. Steele - 28 May 2008 17:57 GMT
You can create a query that returns the last date for each broker using:

SELECT Broker, Max(TransactionDate) As LastTrade
FROM MyTable
GROUP BY Broker

You can then use that query as the basis for whatever it is you're trying to
do.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Sorry.  Me again.  I was wondering.  Because I'm doing this query to run
> from
[quoted text clipped - 16 lines]
>> > from
>> > the current date to come up with the number of days in between?
Andre Adams - 28 May 2008 19:26 GMT
You're great man, thanks.  I have got to learn to write SQL statements.

> You can create a query that returns the last date for each broker using:
>
[quoted text clipped - 25 lines]
> >> > from
> >> > the current date to come up with the number of days in between?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.