|
-
Nov 10th, 2002, 01:39 AM
#1
Thread Starter
Hyperactive Member
CommandText
This is my problem:
Assuming this is my MDB file and their records.
==============================================
Employee
============================
EmployeeNo EmployeeName
============================
HDM23860 Mead Lou
HDM23861 Gou Li
============================
EmployeeData
=======================================
EmployeeNo Date Salary
=======================================
HDM23860 10/22/02 250.00
HDM23861 10/22/02 280.00
HDM23860 10/23/02 0.00
HDM23861 10/23/02 200.00
HDM23860 10/24/02 250.00
HDM23861 10/24/02 280.00
HDM23860 10/25/02 250.00
HDM23861 10/25/02 170.00
HDM23860 10/26/02 125.00
HDM23861 10/26/02 280.00
=======================================
In VB6, I add DataEnvironment. Using Microsoft Jet 4.0 OLE DB Provider.
I add a Command1 and the CommandText is "Select * from Employee"
In Command1, I add a Child Command and the CommandText is "Select * from EmployeeData"
My question is, Is it possible to display the record in EmployeeData from 10/22/02 to 10/24/02?
The output I want is something like this:
HDM23860 Mead Lou
==============================================
HDM23860 10/22/02 250.00
HDM23860 10/23/02 0.00
HDM23860 10/24/02 250.00
HDM23861 Gou Li
==============================================
HDM23861 10/22/02 280.00
HDM23861 10/23/02 200.00
HDM23861 10/24/02 280.00
Marivic reply me like this:
Add it to your commandtext.
commandtext="Select * from EmployeeData WHERE Date>10/22/02 AND Date<10/24/02"
I try the code:
'This code work
DataEnvironment1.Commands(1).Commandtext="Select * from Employee"
DataEnVironment1.rsCommand1.Requery
'But I encounter an error with this code:
DataEnvironment1.Commands(2).CommandText="Select * from EmployeeData WHERE Date>10/22/02 AND Date<10/24/02"
DataEnvironment1.rscommand2.Requery
What is the best thing to do?
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
|