johnnychow
Registered User.
- Local time
- Today, 08:46
- Joined
- Jul 28, 2011
- Messages
- 20
Hi: Please tell me what's wrong on the following, the beging date is ok but the end date is error. If put actual date instead, the statement will be ok. why?
Dim LSQL As String
LSQL = "Select * from [Offering] where [Offering].[OfferDate]" & _
"between #" & Format(Me("TxtBeginDate").Value, "mm/dd/yyyy")" & _
"& "# And #" & Format(Me("TxtEndDate").Value, "mm/dd/yyyy") & "#"
[Form_Statement Subform].RecordSource = LSQL
or
LSQL = "select * from [Offering] where [Offering].[OfferDate] between" & _
"#" & Me.TxtBeginDate & "# and #" & Me.TxtEndDate & "#"
Dim LSQL As String
LSQL = "Select * from [Offering] where [Offering].[OfferDate]" & _
"between #" & Format(Me("TxtBeginDate").Value, "mm/dd/yyyy")" & _
"& "# And #" & Format(Me("TxtEndDate").Value, "mm/dd/yyyy") & "#"
[Form_Statement Subform].RecordSource = LSQL
or
LSQL = "select * from [Offering] where [Offering].[OfferDate] between" & _
"#" & Me.TxtBeginDate & "# and #" & Me.TxtEndDate & "#"