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

Help Conventing Access SQL to ANSI SQL

Status
Not open for further replies.

ironyx

Technical User
Nov 13, 2001
134
US
I need help with a WHERE statement. I don't really understand all of this so I can't tell whether it is an ACCESS SQL that won't work with my ASP pages, or whether this is just something that is not written correctly. I am fairly new to SQL so if anyone could explain what this SQL statement should be accomplishing (if anything at all) with the CLng part, I would appreciate it. I am copying most of these statements from an ACCESS database I am web enabling but have had to rewrite a lot of them to work on my pages. This one has given me a fit!
Any help is sooooo apreciated!

WHERE (((tblParts.PartType)='Cable') AND ((tblLocInv.LocID)=CLng([Forms]![frmPartMaint].[controls]![cboLocID])))

 
WHERE (((tblParts.PartType)='Cable')

The first criterion will select only rows that have the value 'Cable' in the PartType column.

AND ((tblLocInv.LocID)=CLng([Forms]![frmPartMaint].[controls]![cboLocID])))

The second criterion uses the CLng function to convert the value in the combo box control (cboLocID) on the form to a long integer which is then compared to the value in the LocId column. This is a method used when querying by form.

May I recommend that Access Query questions can best be answered in an Access forum such as forum701. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top