SQL keyword AS

  • Thread starter Thread starter Josh Sharpe
  • Start date Start date
J

Josh Sharpe

I'm trying to do the same thing now with a different combo box - but this
combo box is the one that is circularly related. I've pretty much figured
out all the code you sent to me except the AS clause. I'm not sure where
you got the DisplayAddress string from. Where did you get that so I can
apply why you gave me to other combo boxes??

The string you gave me, and i've since modified:

SELECT tblAddress.AddressID, [StreetAddress] & " " & [City] & ", " & [State]
& " " & [ZipCode] & " " & [HomePhone] AS DisplayAddress,
tblAddress.StreetAddress, tblAddress.City, tblAddress.State,
tblAddress.ZipCode, tblAddress.HomePhone FROM tblAddress;

Is DisplayAddress some property somewhere that I can't find?

The other combo box:

SELECT tblCommunity.CommunityID, [FirstName] & " " & [LastName] AS ?????,
tblCommunity.FirstName, tblCommunity.LastName FROM tblCommunity;

-Josh
 
Hi,
You can specify any name you want with the AS keyword.
You're simple giving the calculated field a name, commonly refered to as
an alias.
 
So you're saying that the AS doesn't really make a difference

Then I have a problem: I have a table that is linked to itself, that is a
field is a look-up for the primary key of the same table. For that field I
have the following as the Row Source:

SELECT tblCommunity.CommunityID, [FirstName] & " " & [LastName] AS
DisplayName, tblCommunity.FirstName, tblCommunity.LastName FROM
tblCommunity;

I'm trying to get it to show the First and Last names instead of the number
it's linking to.

What am I doing wrong?

-Josh




Dan Artuso said:
Hi,
You can specify any name you want with the AS keyword.
You're simple giving the calculated field a name, commonly refered to as
an alias.

--
HTH
Dan Artuso, Access MVP


I'm trying to do the same thing now with a different combo box - but this
combo box is the one that is circularly related. I've pretty much figured
out all the code you sent to me except the AS clause. I'm not sure where
you got the DisplayAddress string from. Where did you get that so I can
apply why you gave me to other combo boxes??

The string you gave me, and i've since modified:

SELECT tblAddress.AddressID, [StreetAddress] & " " & [City] & ", " & [State]
& " " & [ZipCode] & " " & [HomePhone] AS DisplayAddress,
tblAddress.StreetAddress, tblAddress.City, tblAddress.State,
tblAddress.ZipCode, tblAddress.HomePhone FROM tblAddress;

Is DisplayAddress some property somewhere that I can't find?

The other combo box:

SELECT tblCommunity.CommunityID, [FirstName] & " " & [LastName] AS ?????,
tblCommunity.FirstName, tblCommunity.LastName FROM tblCommunity;

-Josh
 
Back
Top