G
Guest
Hi!
I am new in SQL, here is a statement. Now I have to select a ID first, I
wish to select a range of it instead. How should I change the code?
Old one
strSel= "Select [DataDate] " & _
" From [Data] " & _
" Where [ID] = '" & Me.SelectedID.Value & "' And " & _
" [ActionDate] Between #" & Me.EndDate.Value & "# And "
& _
" #" & Me.StartDate.Value & "#" & _
" Order by [ActionDate] DESC"
New one
strSel = "Select [DataDate] " & _
" From [Data] " & _
" Where [ID] Between #0# And " & _
" #999# " And & _
" [ActionDate] Between #" & Me.EndDate.Value & "# And "
& _
" #" & Me.StartDate.Value & "#" & _
" Order by [ActionDate] DESC"
I think I have miss something in 4th line. But I not sure what is the
correct stynx.
Thank you very much.
fox
I am new in SQL, here is a statement. Now I have to select a ID first, I
wish to select a range of it instead. How should I change the code?
Old one
strSel= "Select [DataDate] " & _
" From [Data] " & _
" Where [ID] = '" & Me.SelectedID.Value & "' And " & _
" [ActionDate] Between #" & Me.EndDate.Value & "# And "
& _
" #" & Me.StartDate.Value & "#" & _
" Order by [ActionDate] DESC"
New one
strSel = "Select [DataDate] " & _
" From [Data] " & _
" Where [ID] Between #0# And " & _
" #999# " And & _
" [ActionDate] Between #" & Me.EndDate.Value & "# And "
& _
" #" & Me.StartDate.Value & "#" & _
" Order by [ActionDate] DESC"
I think I have miss something in 4th line. But I not sure what is the
correct stynx.
Thank you very much.
fox