Solved

Select statement

Posted on 2012-03-28
5
340 Views
Last Modified: 2012-03-28
I am not sure how to do this in Access.  The below doesnt return any values.  

Select * from table1 where field1 = 2
0
Comment
Question by:Sasha42
  • 3
5 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 37779203
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
 
LVL 1

Expert Comment

by:andresdelfino
ID: 37779208
Is it possible for you to share with us the actual line of code?
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 37779213
post sample values from table1, or upload a copy of the db with the table
0
 

Author Comment

by:Sasha42
ID: 37779246
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
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 37779259
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now