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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit SQL, Help Needed!!!!!

Status
Not open for further replies.

zaq888

MIS
Jun 2, 2003
46
MY
i'm using dataenvironment from vb to generate the sql query. my problem is i'm passing a date value from the datepicker.value and send it to the sql.

SELECT date, time FROM TData WHERE (date BETWEEN ? AND ?) ORDER BY date

? will read data from start.value and end.value(datepicker)

this is one more SQL statemant:

SELECT TUnit.[cs-username]
FROM TUnit LEFT JOIN TData ON TUnit.[cs-username]=TData.[cs-username]
WHERE TData.[cs-username] Is Null;

question: how can i make adjustment on the sql above n combined the sql so it can show only data from date given by user?
 
This would probably do it:

SELECT TUnit.[cs-username]
FROM TUnit LEFT JOIN TData ON TUnit.[cs-username]=TData.[cs-username]
WHERE TData.[cs-username] Is Null
and (Tdata.date BETWEEN ? AND ?)
ORDER BY date;
 
no data is displayed... something wrong i think

what i ant to do is,
first select data from TUnit that range BETWEEN ? AND ?
This is the SQL command:

SELECT date, time, cs-username FROM TData WHERE (date BETWEEN ? AND ?) ORDER BY date

then from the result copy it to temp folder and from there do another sql satement like this:

SELECT TUnit.[cs-username]
FROM TUnit LEFT JOIN TData ON TUnit.[cs-username]=TData.[cs-username]
WHERE TData.[cs-username] Is Null;

but i don't know how to copy the first sql result to temp table/// anybody can help mee???



I'm Keep Studying.... please show the way...
Not Good in English
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top