Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013

    Unanswered: Using a renamed field in the same query

    Hi all,

    I am fairly new to MS Access 2010 ....but have come across a minor challenge....I have a query (named qryDailyReport) which is a 'Query' of other several queries containing common fields 'Week' and 'Day' which I have joined. So in the design view of 'qryDailyReport', I have renamed the fields 'Week' and 'Day' as 'Report_Week' and 'Report_Day' respectively, which seems to work. In the same qryDailyReport, I have other expressions which use the renamed fields 'Report_Week' and 'Report_Day' in calculating running sums and averages from each of the several queries.... Now when I try running 'qryDailyReport', I get the "Enter Parameter Week" and "Enter Parameter Day" errors?

    My question is, is it possible to use a renamed fields in other expressions in the SAME query which you renamed it??

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    When you use an alias (i.e. give a column another name: ColumnName As AliasName) in the SELECT section of a query, you cannot use this alias somewhere else in the SQL expression. This will not work:
    SELECT TableX.ColumnY As AliasZ
    ORDER BY AliasZ
    SELECT TableX.ColumnY As AliasZ
    ORDER BY TableX.ColumnY
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts