Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: WHERE (M.CheckNum)>="1284" And (M.CheckNum)>="1285"

    this is silly!!

    I know that 2 cks are in this db # 1284 & 1285 thier date is 10/15/03
    but when i do this qry my rs only has 1!! record

    i then went to the qry designer added the same sql and agian only 1 rec returned ck #1285

    i switched things around a few times trying
    SELECT CheckNum
    FROM M
    WHERE (((M.CheckNum)>="1284" And (M.CheckNum)<="1285") AND ((m.CheckNum) Like "*-rec") AND ((M.CheckDate)=#10/15/2003#))
    ORDER BY M.CheckNum;

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    why are the numbers surrounded in "" as they should be numeric if you want to use > < = if they're meant to have the "" then try

    SELECT CheckNum
    FROM M
    WHERE ([M].[CheckNum] like "1284" Or [M].[CheckNum] like "1285") And [M].[CheckNum] Like "*-rec" And [M].[CheckDate]=#10/15/2003#
    ORDER BY M.CheckNum;
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Oct 2003
    Posts
    311

    Pls help if u can im toasted and cant fiqure this out

    Originally posted by m.timoney
    why are the numbers surrounded in "" as they should be numeric if you want to use > < = if they're meant to have the "" then try

    SELECT CheckNum
    FROM M
    WHERE ([M].[CheckNum] like "1284" Or [M].[CheckNum] like "1285") And [M].[CheckNum] Like "*-rec" And [M].[CheckDate]=#10/15/2003#
    ORDER BY M.CheckNum;

    The problem is, the person who created the db has the ck field as a txt field not a # field, and the checks are in the form of 1284-rec

    So i am trying to get all cks for the specific ck date. I have been doing this for 2 other departments and the sql worked fine, but then agian i have never had only 2 or less checks for these departments.

    Pls help if u can im toasted and cant fiqure this out

    Thanks M~

  4. #4
    Join Date
    Oct 2003
    Posts
    311

    Re: WHERE (M.CheckNum)>="1284" And (M.CheckNum)>="1285"

    Got it !

    SQLDept = "SELECT Master.CheckNum FROM Master " & _
    " WHERE (((LEFT(Master.CheckNum,4)) >= '" & CInt(Me.txtARECBeg) & _
    "' And (LEFT(Master.CheckNum,4)) <= '" & CInt(Me.txtARECEnd) & "' And (Master.CheckNum) Like ""%-arec"") " & _
    " And ((Master.CheckDate) = #" & CDate(txtDate) & "#)) " & _
    "ORDER BY Master.CheckNum;"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •