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

NEED HELP SELECTING FIELDS FOR RECORDSET FROM MORE THAN ONE TABLE 1

Status
Not open for further replies.

TNN

Programmer
Sep 13, 2000
417
US
Trying to create recordset from 2 different tables. There are no common fields with the same value and the data types are different.I tried the following:

SELECT OVER, NOTOVER,CONSTANT,PERCENT,ANNFEDWHALO
FROM ANNTAXS,FEDTAXLIMITS
WHERE 3000 BETWEEN OVER AND NOTOVER

Error message says I have error in from clause. I am using an Access 2000 database. My documentation for ANSI SQL says the above from clause is valid. Is there a variation in MSSQL???

Can't use INNER JOIN because have no common field values.
Can't use RIGHT JOIN or LEFT JOIN because have different field data types.
Any help is appreciated.
TNN, Tom
TNPAYROLL@AOL.COM




TOM
 
Tom, even if the query did work, you'll get a cross-join (each record of table1 is matched with every record of table2); is that going to be useful for you?

I'm not an Access user, but I'm wondering if you might have some reserved-words conflicts (built-in keywords that should not be used for user-created objects) with over, constant, and percent.

Robert Bradley

 
You can convert the data types in a SQL statement.
Look at CONVERT and CAST in books on-line that came with SQL server.

Or in Access anything that starts with a 'C' like CInt or CStr, CDbl etc.


DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
DougP,
The syntax I was using was correct. It worked fine after I fixed my stupid mistake of mis-typing a field name.

Thank you for bringing to my attention CONVERT & CAST. I will look them up for future reference.

TNN, Tom
TNPAYROLL@AOL.COM

TOM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top