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

select statement syntax

Status
Not open for further replies.

twcman

Programmer
Joined
Jun 28, 2001
Messages
284
Location
US
what is the proper syntax for this select statement using an access database:

SELECT tlkpDonorLevel.DonorLevelID, [Lower] & " to " & [Upper] AS Range
FROM tlkpDonorLevel;

I am combining the two fields from a record to make one variable. Lower and Upper are the field names.

 
It seems like what you have would work fine. Is it returning an error or something?
 

I assume [Lower} and [Upper} are numeric. If so, you'll need to use the following syntax to convert them to text strings.

SELECT
tlkpDonorLevel.DonorLevelID,
CStr([Lower]) & " to " & CStr([Upper]) AS Range
FROM tlkpDonorLevel; Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 

Whoops! This is the SQL Server forum. You should use the following instead of what I said in the previous post.

SELECT
tlkpDonorLevel.DonorLevelID,
LTrim(Str([Lower])) & " to " & LTrim(Str([Upper])) AS Range
FROM tlkpDonorLevel; Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top