hello all,
i run my reports using MS Query to access SQL database then i save as xls file and do all sorting and deleting data and so. Is there an easier way to import requested data directly by adding certain conditions example getting records between certain dates or by family names..etc.
thanks
Evil is the root of all Mon$y
Can't you specify your requirements in your SQL code pulling the data?
Click the * below to say thanks
Girls sleep with guys who use photoshop, but marry the ones who work with Excel
Corduroy pillows: They're making headlines!
Did you mean: recursion
http://www.google.com/search?hl=en&q=recursion
yes i can but how to put one condition with multiple names example pulling records wich contain family name "James,Davis,O'reily" only
In Creiteria Field in can select only one name.
Evil is the root of all Mon$y
Can't you write the SQL freehand?
Click the * below to say thanks
Girls sleep with guys who use photoshop, but marry the ones who work with Excel
Corduroy pillows: They're making headlines!
Did you mean: recursion
http://www.google.com/search?hl=en&q=recursion
In general, you'd use the IN function:
SELECT * FROM yourTable WHERE familyName IN ('James', 'Davis', 'O'Riely');
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
dear all,
to make it easy here is the original dqy in notepad
============
XLODBC
1
DSN=EDT_test1;Description=test;UID=sa;APP=Microsoft Office 2003;WSID=test-VSNET;DATABASE=CarData;Network=DBMSSOCN;Regional=Yes
SELECT CarTravelsFormBaseQry.CarNumber, CarTravelsFormBaseQry.StartDate, CarTravelsFormBaseQry.StartDistance, CarTravelsFormBaseQry.EndDistance, CarTravelsFormBaseQry.DriverCard, CarTravelsFormBaseQry.Destination, CarTravelsFormBaseQry.DriverName, CarTravelsFormBaseQry.DriveDistance, CarTravelsFormBaseQry.StartHour, CarTravelsFormBaseQry.EndHour FROM CarData.dbo.CarTravelsFormBaseQry CarTravelsFormBaseQry WHERE (CarTravelsFormBaseQry.StartDate>=? And CarTravelsFormBaseQry.StartDate<=?) AND (CarTravelsFormBaseQry.DriverCard Like '0%') ORDER BY CarTravelsFormBaseQry.CarNumber
Parameter Parameter
11 11
CarNumber StartDate StartDistance EndDistance DriverCard Destination DriverName DriveDistance StartHour EndHour
==================
currently the output is all trips with id card greater than zero.
my requirement is to limit output under destination values only equal to (townsquare,mall,HQ)
so how to insert these under "Destination "
thank you
Evil is the root of all Mon$y
Add
AND (CarTravelsFormBaseQry.Destination IN ('townsquare','mall','HQ'))
to your WHERE clause.
Good luck.
thank you
works fine
Evil is the root of all Mon$y
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks