General Forum - Forums about everything!




Advanced Computer Discussion Talk about more advanced computer related subjects in here. i.e. programming, networking, OS configurations, etc.

Go Back   General Forum > General > Technology > Computers > Advanced Computer Discussion

» Sponsored Ads
 



160X600 - Love Your New Phone

Reply
 
Thread Tools Display Modes
  #1 
Old 06-18-2008, 02:46 AM
Boredie's Avatar
Boredie
In need of Entertainment
 
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")%>&nbsp;</td><td><%=rs("ProjectName")%>&nbsp;</td><td><%=rs("Date")%>&nbsp;</td><td><%=rs("Amount")%>&nbsp;</td><td><%=rs("WorkerId")%>&nbsp;</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



Last edited by Boredie; 06-18-2008 at 02:46 AM.. Reason: Automerged Doublepost

Join GeneralForum.com Today!

Join GeneralForum.com today for FREE!

GeneralForum.com is the fastest growing general forum on the web!

  • Join thousands of discussions on every topic imaginable!
  • Chat with people from all over the world in real time!
  • Play live games with other members in real time! 
  • Make new friends, discuss new ideas, talk about whatever!
  • Yes, it's free! What are you waiting for? DO IT NOW!
» Click here to join the fun!

Closed Thread

  General Forum > General > Technology > Computers > Advanced Computer Discussion

Bookmarks



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


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



 


All times are GMT -6. The time now is 03:01 AM.

Powered by: vBulletin | Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Site designed and maintained by NURV® Original Concepts, Graphics, and Design Copyright © NURV® 2010
All user submitted content, threads and posts becomes the copyright-protected property of GeneralForum.com unless previously copyrighted.
The views and opinions expressed on this site are not necessarily the views of the staff or administration.
We are not responsible, nor can we be held liable for information posted on this site, or what it influences you to do.
Rules & Privacy Policy

3D Motion Graphics | Poker Design | Web Design | Mafia Graphics | Pop Culture News | Money Forum | Make Money Online | Stephen King