|
|||||||||
|
|
|||||||||
|
Advanced Computer Discussion Talk about more advanced computer related subjects in here. i.e. programming, networking, OS configurations, etc. |
|
||||||
|
& Great Prizes! |
|
& Degrees |
|
|
| Join GeneralForum.com Today! |
Join GeneralForum.com today for FREE!GeneralForum.com is the fastest growing general forum on the web!
» Click here to join the fun! |
| GF Sponsor |
Get Your Dream Phone Free with a Service Plan!LetsTalk simplifies the process of buying wireless products and services.
» 30-Day Satisfaction Guarantee! Click HERE to get started! |
![]() |
|
|
#1
|
|||
|
|||
|
Date Range Problem
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 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 Bored out of my mind.
Last edited by Boredie; 06-18-2008 at 02:46 AM.. Reason: Automerged Doublepost |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Spring 2008 Anime Season | Vegito728 | Anime | 13 | 04-14-2008 07:21 PM |
| a problem | newgirlintown | Advice Board | 13 | 02-16-2008 08:18 AM |