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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

assigning a value to a date variable

Status
Not open for further replies.

demills

Programmer
Jun 14, 2002
10
CA
Hi All

This is probably a simple question.
I'm having a problem assigning a value to a date variable. What i'm looking for is something like this -

Dim RptYear As Integer
Dim RptDate As Date

If month(Now()) < 6 Then
RptYear = Year(Now()) - 2
Else
RptYear = Year(Now()) - 1
End If
RptDate = #06/30/#+RptYear

It doesn't like the last statement.
 




Hi,
Code:
RptDate = DateSerial(rptyear,06,30)

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Excellent worked perfectly. I knew it was something simple.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top