Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2003, 08:01 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access alias question


How can I assign an 'alias' to my record set ?

Eg. using the following query

  select item.id,item.name,item.price, stock.level from items
  join stocks on item.id=stock.id where item.id > 2000

How can I set the resulting record set to be known as 'myResults' ?
 
Old December 12th, 2003, 12:36 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Quote:
quote:Originally posted by badgolfer


How can I assign an 'alias' to my record set ?

Eg. using the following query

select item.id,item.name,item.price, stock.level from items
join stocks on item.id=stock.id where item.id > 2000

How can I set the resulting record set to be known as 'myResults' ?

add as at end of your select statement
select item.id,item.name,item.price, stock.level from items
  join stocks on item.id=stock.id where item.id > 2000
as my results

[u]Documentation from help file</u>
setting
You can use a string expression (string expression: Any expression that evaluates to a sequence of contiguous characters. Elements of the expression can include: a function that returns a string or a string Variant (VarType 8); a string literal, constant, variable, or Variant</.) to set the Alias property to any name not currently being used in the database. You set this property in query Design view (Design view: A window that shows the design of these database objects: tables, queries, forms, reports, macros, and data access pages. In Design view, you can create new database objects and modify the design of existing ones.) by right-clicking the field list in the query design grid and clicking Properties.

You can set the Alias property in SQL view of the Query window by using an AS clause in the SQL statement.

Remarks







 
Old December 15th, 2003, 04:47 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

many thanks )))





Similar Threads
Thread Thread Starter Forum Replies Last Post
Circular reference caused by alias "May" jackpeters55 Access VBA 0 December 22nd, 2004 12:42 PM
date formate in alias mateenmohd SQL Server 2000 1 November 7th, 2004 02:58 AM
Access alias question badgolfer VB Databases Basics 1 December 12th, 2003 11:56 PM
The Alias Problem byterbit SQL Language 3 July 3rd, 2003 07:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.