Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date question

Status
Not open for further replies.

LastCyborg

Programmer
Feb 7, 2003
256
MX
I have a Field that contains a Date, but I need to show that Date plus 8 days, is there an easy way to do this or I have to code the function?

Example:
RecordField = 01/01/04
DataToShow = 09/01/04

The problem is when I have to change the mont or year, etc

--- LastCyborg ---
 
How are ya LastCyborg . . . . .

Something like:
Code:
[blue]   DateToShow = RecordField + 8[/blue]
Be aware:
[blue]Integer of Date = Date Part

Fractional Part = Time Part

1 Day = 1
1Hour = 1/24 = 4.16666666666666666666666666666e-2
1 Minute = 6.94444444444444444444444444444e-4
1 Sec = 1.15740740740740740740740740740e-5

12 Noon = .5[/blue]

Calvin.gif
See Ya! . . . . . .
 
I tried it, but appears #Error in TextBox where I put that
 
You need to use the DateAdd Function

DateAdd("d", 8, me.RecordField)


I haven't failed, I have just found 10,000 ways that it won't work!
 
LastCyborg . . . . .

For an unbound textbox, the [blue]ControlSource[/blue] property should be:
Code:
[blue] = DateFieldName + 8[/blue]
In VBA its:
Code:
[blue]Me!TextBoxName = Me!DateFieldName + 8[/blue]
If your still having problems, post back what your using & where you your using it. . . .

[blue]txaccess[/blue] . . . have you tried it?


Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top