Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 4th, 2003, 06:29 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default Greater than

Dear PRogrammers,

how come this piece of code works :

strSQL = strSQL & "SELECT *FROM(Requests) "
        strSQL = strSQL & "WHERE ([StartDate]= #" & kStart & "#);"

**********Note the '=' sign before the #

but this code does not :

strSQL = strSQL & "SELECT *FROM(Requests) "
        strSQL = strSQL & "WHERE ([StartDate]>= #" & kStart & "#);"

returns no result when I used >= ...? no error just does not return any results....


Here is the rest of the code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        Dim StrConnect As String
        Dim cn As ADODB.Connection
        Dim rs As ADODB.Recordset

        'Dim nStart As String
        Dim nStart As Date
        Dim nStop As Date
        Dim nItem As String
        Dim LStart As Date
        Dim LStop As Date
        Dim strSQL As String
        Dim kStart As Date
        Dim kStop As Date


        kStart = txtStart.Text
        kStop = txtEnd.Text

        StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\DATA\ACCESS\13FloorEquipment.mdb"

        cn = New ADODB.Connection()
        cn.Open(StrConnect)
        nItem = CboItems.Text



        strSQL = strSQL & "SELECT *FROM(Requests) "
        strSQL = strSQL & "WHERE ([StartDate]>= #" & kStart & "#);"

        'strSQL = strSQL & "SELECT *FROM(Requests) "
        'strSQL = strSQL & "WHERE ([ItemName]= '" & nItem & "');"


        'strSQL = strSQL & "AND ([StartDate]>= #" & LStart & "#)"
        'strSQL = strSQL & "AND ([EndDate]<= " & LStop & "));"

        'WHERE (((Requests.ItemName)="LapTop") AND ((Requests.StartDate)>#11/1/2003#) AND ((Requests.EndDate)<#11/21/2003#));
        MsgBox(kStart)
        MsgBox(kStop)
        MsgBox(strSQL)
        rs = cn.Execute(strSQL)


        While Not rs.EOF
            nStart = rs.Fields("StartDate").Value.ToString.TrimEnd
            nStop = rs.Fields("EndDate").Value.ToString.TrimEnd
            nItem = rs.Fields("ItemName").Value.ToString.TrimEnd
            LStart = rs.Fields("StartTime").Value.ToString.TrimEnd
            LStop = rs.Fields("EndTime").Value.ToString.TrimEnd

            Listbox1.Items.Add(nItem & vbTab & nStart & vbTab & LStart & vbTab & nStop & vbTab & LStop)
            rs.MoveNext()
        End While


        rs.Close()
        cn.Close()

    End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Greater than, less than jroxit Classic ASP Basics 3 February 1st, 2008 06:38 PM
Uplad txt field of size greater than 12 mb rapraj PHP Databases 3 October 28th, 2007 09:36 AM
Warning: fread(): Length parameter must be greater surendran PHP How-To 1 September 20th, 2006 05:41 AM
Upload Files of Greater Size (>5Mb) saravananedu ASP.NET 1.0 and 1.1 Basics 1 May 4th, 2005 12:07 AM
Select Where Greater Than Count [email protected] SQL Language 3 April 29th, 2004 05:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.