I made a Data report. I write code like:
select *from table1 where date1 and date2 between dtpicker1.value and dtpicker2.value
but the data not show in report. but when I write like:
select *from table1 where date1 and date1 between dtpicker1.value and dtpicker2.value
then data show. what problem? another thing I used three date and I want all data of this three date will show in report.
abu taher
34
Practically a Posting Shark
Recommended Answers
Jump to PostWell the between operator is for use on one field so...
SELECT * FROM Table1 WHERE (Date1 AND Date1 BETWEEN DTP1.Value AND DTP2.Value) AND (Date2 AND Date2 BETWEEN DTP1.Value AND DTP2.Value)
As for three dates...
SELECT * FROM Table1 WHERE DATE1 = Value1 OR Date1 = Value2 …
Jump to Posttry something like....
SELECT * FROM Table1 WHERE (Date1 >= DTP1.Value AND Date1 <= DTP2.Value) AND (Date2 >= DTP1.Value AND Date2 <= DTP2.Value) AND (Date3 >= DTP1.Value AND Date3 <= DTP2.Value)
Which is or should be the same as the between statement and if this does not work …
All 5 Replies
abu taher
34
Practically a Posting Shark
vb5prgrmr
143
Posting Virtuoso
abu taher
34
Practically a Posting Shark
vb5prgrmr
143
Posting Virtuoso
dspnhn
10
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.