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

New to SQL need help!

Status
Not open for further replies.

TheEvilZX2

Technical User
Aug 9, 2006
7
US
I am trying to learn SQL to use Motor Marketing Machine for the shop I work at. Motor is an automotive shop program, part of the motor program is Motor Marketing Machine, which uses SQL to query customer data.

Thanks to gmmastros in the microsoft server SQL forums we believe the marketing machine is using Access databases.

I have found several .mdb extensions in the motor program's folder. But i am unable to open them and view any data. It will open the file in access but no data will be shown.

If anyone could be of any help it would be greatly appreciated.
 
Perhaps the tables are hidden or are named as such that access thinks they are system tables, which are not displayed by default. In Access, go to tools/options and check the boxes to view hidden and system files. Maybe then you'll be able to see those tables!

~Melagan
______
"It's never too late to become what you might have been.
 
ok well i managed to get one of that databases to show up. by opening access by itslef then opening the database from there.

my origional problem was that i was trying to bring up all of our customers who had spent money with us in the 2005 year and 2004 year.

the SQL statement i thought was going to work was:

select * from customer where dollars spent > 0 since #01/01/05# and #12/30/05#

The marketing machine tells me:

Invalid SQL statement. Error: Syntax error (missing operator) in query expression 'dollarsspent > 0 since #01/01/05# and #12/30/05#'


We bought the SQL for Dummies Book and it doesnt seem to help much.


does anyone know what statement i should us to bring this up?
 
Maybe something like:

SELECT * FROM CUSTOMER WHERE CUSTOMERID IN (SELECT CUSTOMERID FROM SalesTable WHERE SalesDate BETWEEN #01/01/2004# AND #12/31/2005#)

Did you look at the customer table? Is there a field named Dollars? I don't think SINCE is a valid KEYWORD.

If it's a normalized database you should have different tables for CUSTOMERS and SALES.

HTH

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top