Results 1 to 13 of 13

Thread: can tell me wat's wrong?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Singapore
    Posts
    118

    Question can tell me wat's wrong?

    VB Code:
    1. invdate <= #" & cboTdate & " # and invdate >= #" & cboFdate & " #

    both cboTdate and cbdFdate are combo boxes that contain date values..

    the thing is, when cboTdate is 1-Apr-2002 and cboFdate is 20-Apr-2002, the output is correct ..

    but if cboFdate is 30-Mar-2002 and cboTdate is 20-Apr-2002, nothing comes out.. is my code wrong?
    Last edited by fujin; Apr 17th, 2002 at 05:02 AM.
    FujIn

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Your code is confusing to me...could you give us the whole line. What you had is just one big syntax error...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    chennai
    Posts
    3
    hai

    about your date problem

    convert the date into

    clng(cdate(invdate) <= clng(cdate(cbotdate) .......

    try this one


    with regards
    gopi
    with love
    Gopieswaran

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Singapore
    Posts
    118
    Originally posted by The Hobo
    Your code is confusing to me...could you give us the whole line. What you had is just one big syntax error...
    .Open "SELECT * from internal where procode = '" & cmbProd.Text & "' and bracode = '" & cmbSup.Text & "' and invdate <= #" & cmbTdate & " # and invdate >= #" & cmbFdate & " # order by type, invdate", conn, adOpenForwardOnly, adLockReadOnly
    FujIn

  5. #5
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    Just my two cents. I think it is much, much easier to use BETWEEN than to use to equality operators.

    This finds everything inclusive of the two dates:

    WHERE Date BETWEEN Date1 AND Date2

    This finds everything outside the two dates:

    WHERE Date NOT BETWEEN Date1 AND Date2

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Singapore
    Posts
    118
    Originally posted by fujin


    it doesn't work .. sob sob
    VB Code:
    1. .Open "SELECT * from internal where clng(cdate(invdate)) <= clng(cdate(#" & cmbTdate & "#)) and clng(cdate(invdate)) >= clng(cdate(#" & cmbFdate & "#)) order by type, invdate", conn, adOpenForwardOnly, adLockReadOnly
    FujIn

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Is that a "yes, it's working?"

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Singapore
    Posts
    118
    Originally posted by mendhak
    Is that a "yes, it's working?"
    nope, it doesn't
    FujIn

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by fujin


    VB Code:
    1. .Open "SELECT * from internal where invdate <= " & clng(cdate(cmbTdate)) & " AND invdate >= " & clng(cdate(cmbFdate)) & " order by type, invdate", conn, adOpenForwardOnly, adLockReadOnly


    now?

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Singapore
    Posts
    118
    Originally posted by mendhak


    now?
    nope.. btw, my date format is dd-mmm-yyyy .. does it make any diff?

    for 10-Mar-2002 and 15-Apr-2002 , it works

    but for 15-Mar-2002 and 10-Apr-2002, it doesn't
    Last edited by fujin; Apr 17th, 2002 at 05:03 AM.
    FujIn

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Singapore
    Posts
    118
    thank thanks.. work already... my database had some fault.. eheh sorry2..
    FujIn

  12. #12
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Hallelujah! Praise the lord!

  13. #13
    Addicted Member
    Join Date
    Feb 2002
    Location
    Belgium
    Posts
    190
    Thry this to if your prog works writh with these data
    date1 "1/04/2002"
    date2 "9/04/2002"

    my prog fails when the days are smaller than 10.

    if it works on your prog
    please let me now

Posting Permissions

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



Click Here to Expand Forum to Full Width