K
kevcar40
hi
I am having a problem query dates,
i am importing a spredsheet from Excel with serval fields on it on of
which is a date field
on the Excel sheet the column is formated as short date
i am trying to query over a date range
i am using the fuction below
Function SQLDate(vDate As Variant) As String
If IsDate(vDate) Then
SQLDate = "#" & Month(vDate) & "/" & Day(vDate) & "/" &
Year(vDate) & "#"
End If
End Function
txtStartDate and txtEndDate are both Text Boxes on a form
the line that queries the dates is
"WHERE All_Areas_Result.Date Between" &
SQLDate(Me.txtStartDate.Value) & "and " & SQLDate(Me.txtEndDate.Value)
Unfortunately all the dates are being returned
Can anyone help please
Thanks
Kevin
I am having a problem query dates,
i am importing a spredsheet from Excel with serval fields on it on of
which is a date field
on the Excel sheet the column is formated as short date
i am trying to query over a date range
i am using the fuction below
Function SQLDate(vDate As Variant) As String
If IsDate(vDate) Then
SQLDate = "#" & Month(vDate) & "/" & Day(vDate) & "/" &
Year(vDate) & "#"
End If
End Function
txtStartDate and txtEndDate are both Text Boxes on a form
the line that queries the dates is
"WHERE All_Areas_Result.Date Between" &
SQLDate(Me.txtStartDate.Value) & "and " & SQLDate(Me.txtEndDate.Value)
Unfortunately all the dates are being returned
Can anyone help please
Thanks
Kevin