Solved

Select statement

Posted on 2012-03-28
5
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

615 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