dbTalk Databases Forums  

Current/System date in Access

comp.databases.ms-access comp.databases.ms-access


Discuss Current/System date in Access in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Bas Cost Budde
 
Posts: n/a

Default Re: Current/System date in Access - 11-30-2004 , 03:50 PM






Miikka Hamalainen wrote:
Quote:
Hi All,

I'm making library db using SQL.

I have date when book has been loaned (Date loaned) and date to return the
book (Return date), which is 4 weeks.

How can I get current date to show in Date loaned-field?
How do I add 4 weeks to date loaned and can I do it in INSERT
INTO-sentence?
If Date() [the current date] is not recognized as a valid function when
you execute the INSERT INTO, you have to pass it as a parameter. You can
use its value+28 for [return date] then.

Could it be that simple?

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea


Reply With Quote
  #12  
Old   
Billie Kennedy Jr
 
Posts: n/a

Default Re: Current/System date in Access - 12-01-2004 , 12:50 PM






Why is it imperative that you must us an SQL command to add this to
your fields?

I would think that having a form with the option to change the value
would be better.

If you really must have a SQL Statement you could just do something
like:

Private Sub Loaned_Date_DblClick(Cancel As Integer)

If IsNull(Me.Loaned_Date) Then
Exit Sub
End If

Me.Loaned_Date = Date
Me.Refresh

$returnDate = = DateAdd("d", 28, Me.Loaned_Date)

DoCmd.RunSQL "UPDATE myTable SET returnDate = '" & $returnDate & "'
WHERE LoanId = '" & $loanId & "';"

End Sub


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.