Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

Select statement

I am not sure how to do this in Access.  The below doesnt return any values.  

Select * from table1 where field1 = 2
0
Sasha42
Asked:
Sasha42
  • 3
1 Solution
 
Rey Obrero (Capricorn1)Commented:
if field1 is Text Data type, use this

Select * from table1 where field1 = "2"


are you sure that there is value 2 in field1 ?
0
 
andresdelfinoCommented:
Is it possible for you to share with us the actual line of code?
0
 
Rey Obrero (Capricorn1)Commented:
post sample values from table1, or upload a copy of the db with the table
0
 
Sasha42Author Commented:
Below is the query sql.  I was hoping to be able to use the * instead of all those field names:

"SELECT tblCapRequestlMain.ID, tblCapRequestlMain.CapEXID, tblCapRequestlMain.DateOfRequest, tblCapRequestlMain.ProjectName, tblCapRequestlMain.Proj_Nbr, tblCapRequestlMain.Status, tblCapRequestlMain.BusinessUnit, tblCapRequestlMain.Company, tblCapRequestlMain.Dept, tblCapRequestlMain.RequestersFirstName, tblCapRequestlMain.RequestersLastName, tblCapRequestlMain.RequestersTitle, tblCapRequestlMain.RequestersPhone, tblCapRequestlMain.RequestersEmailAddress, tblCapRequestlMain.GateKeeperName, tblCapRequestlMain.GateKeeperPhone, tblCapRequestlMain.GateKeeperEmailAddress, tblCapRequestlMain.Budgeted, tblCapRequestlMain.RequiredByState, tblCapRequestlMain.ApprovedBudgetAmt, tblCapRequestlMain.RequestAmt, tblCapRequestlMain.EstimatedFreightDelivery, tblCapRequestlMain.EstimatedTax, tblCapRequestlMain.StatusChangeDate
FROM tblCapRequestlMain
WHERE tblCapRequestlMain.ID=2"
0
 
Rey Obrero (Capricorn1)Commented:
there is no problem using * in a query


if ID is text Data Type

select *
from tblCapRequestlMain
where ID="2"

or if ID is Number Data type, this should work

select *
from tblCapRequestlMain
where ID=2


just make sure there is a value equal to 2 in the field ID
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now