Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query between VB and Dbase IV

Status
Not open for further replies.

nicholasting

Programmer
Jul 28, 2006
15
MY
SQL------------------------------------------------

SELECT T1.RCP_NO, T2.DSCCODE, T2.DSCVALUE, T1.BN_DT
FROM DETAIL T1 LEFT JOIN DISCOUNT T2 ON T1.PROD_CD = T2.DSCCODE
WHERE (cdate(T1.BN_DT) >= '01/Sep/2007' AND cdate(T1.BN_DT) <= '15/Sep/2007')

--------------------------------------------------

with the SQL query above, i'm using VB6 to query data from Dbase IV database. but it return back the records within the period selected and also after the period. i just want the data within the 1 - 15 sept 2007

can someone give me guide! thanks.

PS: my data is until 3rd OCT 2007,
 





Hi,

DATES. Looks as if your Date ctireria is TEXT, and think about how the TEXT form of dd/mmm/yyy sorts.
Code:
WHERE (Format(T1.BN_DT,'yyyymmdd') >= '20070901' AND Format(T1.BN_DT,'yyyymmdd') <= '20070915')

Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top