User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 391,616 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,638 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting

Help with dates please

Join Date: Jul 2006
Posts: 9
Reputation: GavinC is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
GavinC GavinC is offline Offline
Newbie Poster

Help Re: Help with dates please

  #4  
Jul 26th, 2006
Originally Posted by campkev
can you post your output?

Hey there, o.k. I have redone the code work and now what I get is just a list of dates... basically everything out of the database.... not the specific one I am looking for.

i.e:
7-9-2006 This is the Info from the previous page
Date as converted back to US 7/9/2006

RETREIVING INFO FROM THE DATABASE ACCORDING TO DATE ENTERED
Take the date from the previous page and converted 7/9/2006
and match it up in DB.
7/9/2006
8/23/2007
7/8/2006
9/23/2006
10/7/2006
8/15/2006
9/4/2007
11/6/2007
1/19/2008
11/7/2007
4/6/2007
6/5/2007
11/28/2007
12/2/2007
10/30/2007
7/5/2007

and the list Goes on, here is the code for it....

<%
    Dim strSearchDate
        strSearchDate = Request.Form("searchdate")
       
        
    Response.Write strSearchDate & ("&nbsp;This is the Info from the previous page<BR>")
    
    'Convert the date to US standard for strSearchDate'
        Dim varDate
        Dim varLocale
        Dim dattoUS
        
            varLocale = SetLocale(1033)
            varDate = strSearchDate
            dattoUS = FormatDateTime(varDate, 2)
            
        Response.Write ("Date as converted back to US") & " " & ("<font color='red'>") & dattoUS & ("</font><br><br>")
%>
<!-- RETREIVING INFO FROM THE DATABASE ACCORDING TO DATE ENTERED -->
<%
    Response.Write ("<font color='red'><strong><u>RETREIVING INFO FROM THE DATABASE ACCORDING TO DATE ENTERED</u></strong></font><br>")
    Response.Write ("Take the date from the previous page and converted") & " " & ("<font color='red'>") & dattoUS & ("</font><br>")
    Response.Write ("and match it up in DB.<br>")
    
    'Connect to the DB'
    Dim adoCon
    Dim objRS
    Dim strSQL
    
    Set adoCon = Server.CreateObject("ADODB.Connection")
    adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../sms.mdb")
    Set objRS = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM clients"
    objRS.Open strSQL, adoCon
        
    Do while not objRS.EOF
        Dim dattodb
            dattodb = dattoUS
                'Response.Write dattodb & ("<BR>")
                
            if objRS("datetosend") = dattodb Then
                Response.Write ("Not Found")                
            Else
                Response.Write objRS("datetosend") & ("<BR>")
            End if
    objRS.MoveNext
    loop
%>

Dunno what I am doing wrong here.... Any ideas???
Reply With Quote  
All times are GMT -4. The time now is 12:24 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC