SQL date function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an SQL rowsource/date function it works well, but if i dont have any
valuse in the start and end time text boxes then no records will show up,,, I
would like the coding for the sql to show all records when the text fileds
are blank

here is one of my Command SQL,, what do i need to add

Me.List4.Rowsource = "select.....From... Where table.Numbers '*" &
Me.comb_1 & "*' And [dateLocated] Between......
 
Try this --
Me.List4.Rowsource = "select.....From... Where table.Numbers '*" &
Me.comb_1 & "*' And ([dateLocated] Between...... Or [dateLocated] Is Null)
.....
 
Sorry, Thank you for your help but it does not work

KARL DEWEY said:
Try this --
Me.List4.Rowsource = "select.....From... Where table.Numbers '*" &
Me.comb_1 & "*' And ([dateLocated] Between...... Or [dateLocated] Is Null)
....

BIGRED56 said:
I have an SQL rowsource/date function it works well, but if i dont have any
valuse in the start and end time text boxes then no records will show up,,, I
would like the coding for the sql to show all records when the text fileds
are blank

here is one of my Command SQL,, what do i need to add

Me.List4.Rowsource = "select.....From... Where table.Numbers '*" &
Me.comb_1 & "*' And [dateLocated] Between......
 
You're missing the keyword LIKE between table.Numbers and '*" & Me.comb_t &
"'...

This assumes, of course, that Numbers is a text field. If it's numeric (as
the name would imply), you cannot use wildcards with it.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


BIGRED56 said:
Sorry, Thank you for your help but it does not work

KARL DEWEY said:
Try this --
Me.List4.Rowsource = "select.....From... Where table.Numbers '*" &
Me.comb_1 & "*' And ([dateLocated] Between...... Or [dateLocated] Is
Null)
....

BIGRED56 said:
I have an SQL rowsource/date function it works well, but if i dont have
any
valuse in the start and end time text boxes then no records will show
up,,, I
would like the coding for the sql to show all records when the text
fileds
are blank

here is one of my Command SQL,, what do i need to add

Me.List4.Rowsource = "select.....From... Where table.Numbers '*" &
Me.comb_1 & "*' And [dateLocated] Between......
 
Back
Top