I see I'm the first to post in this sub-forum.
I wonder if it's worth the typing. LOL
Well here is the problem:
I have a db with dates.
I have an sql select statement that is able to select records with a range of dates.
The problem occurs when I choose a range of dates from 2 different months.
Code:
rs.open "select * from Timing where ProjectName='"&request.form("projs")&"' and [Date]<=#"&request.form("date2")&"# and [Date]>=#"&request.form("date1")&"# order by [Date],ProjectName asc", Conn
%>
<table border=1 width=40%><caption>date range: <%=request.form("date1")%> - <%=request.form("date2")%></caption>
<tr><th>code</th><th>project</th><th>date</th><th>time</th><th>employee</th></tr>
<%
while not rs.eof
%>
<tr><td><%=rs("ProjId")%> </td><td><%=rs("ProjectName")%> </td><td><%=rs("Date")%> </td><td><%=rs("Amount")%> </td><td><%=rs("WorkerId")%> </td></tr>
<%
rs.movenext
wend
%>
</table>
When I choose dates in the same months I get the display I need.
When I choose dates in different months it will not display the info. It doesn't give an error, it just doesn't display the range of requested dates (and I've checked to see if this range exists in the db). I've also tried putting the requested dates in the sql statement with the same result.
Any suggestions?
------
I got a response in another forum with a solution.
I needed to use the BETWEEN option.
Code:
select * from --- where [date] between date1 and date2