|
-
Apr 8th, 2002, 10:42 PM
#1
Thread Starter
Lively Member
can tell me wat's wrong?
VB Code:
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
-
Apr 8th, 2002, 10:44 PM
#2
Stuck in the 80s
Your code is confusing to me...could you give us the whole line. What you had is just one big syntax error...
-
Apr 8th, 2002, 10:51 PM
#3
New Member
hai
about your date problem
convert the date into
clng(cdate(invdate) <= clng(cdate(cbotdate) .......
try this one
with regards
gopi
-
Apr 8th, 2002, 11:20 PM
#4
Thread Starter
Lively Member
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
-
Apr 8th, 2002, 11:26 PM
#5
PowerPoster
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
-
Apr 17th, 2002, 03:56 AM
#6
Thread Starter
Lively Member
Originally posted by fujin
it doesn't work .. sob sob
VB Code:
.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
-
Apr 17th, 2002, 03:58 AM
#7
Is that a "yes, it's working?"
-
Apr 17th, 2002, 04:14 AM
#8
Thread Starter
Lively Member
Originally posted by mendhak
Is that a "yes, it's working?"
nope, it doesn't
-
Apr 17th, 2002, 04:18 AM
#9
Originally posted by fujin
VB Code:
.Open "SELECT * from internal where invdate <= " & clng(cdate(cmbTdate)) & " AND invdate >= " & clng(cdate(cmbFdate)) & " order by type, invdate", conn, adOpenForwardOnly, adLockReadOnly
now?
-
Apr 17th, 2002, 04:56 AM
#10
Thread Starter
Lively Member
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
-
Apr 17th, 2002, 05:12 AM
#11
Thread Starter
Lively Member
thank thanks.. work already... my database had some fault.. eheh sorry2..
-
Apr 17th, 2002, 05:16 AM
#12
Hallelujah! Praise the lord!
-
Apr 17th, 2002, 05:42 AM
#13
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|