A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Computed Columns in Access 2007 Query (adp/SQL)



 
 
Thread Tools Display Modes
  #1  
Old July 4th, 2007, 04:50 PM posted to microsoft.public.access.queries
Ian Bateman
external usenet poster
 
Posts: 23
Default Computed Columns in Access 2007 Query (adp/SQL)

I cannot find anything in the help files to assist me with computed columns
in a Access Queries using adp/SQL. For example when using Access (mdb) I
could put Member:iif([Paid]0,"YES","NO"), which would result in a column
called Member with a value of either Y or N depending on the value of [Paid].

This cannot be done using adp/SQL. The query designer simply puts quotes
around the entire statement and outputs that. Please could you tell me where
I can I find a useful reference guide that will tell me how to construct
computed columns in Access queries using adp/SQL?

Many Thanks
Ian


  #2  
Old July 5th, 2007, 03:01 PM posted to microsoft.public.access.queries
Gary Walter
external usenet poster
 
Posts: 613
Default Computed Columns in Access 2007 Query (adp/SQL)


"Ian Bateman" wrote:
I cannot find anything in the help files to assist me with computed columns
in a Access Queries using adp/SQL. For example when using Access (mdb) I
could put Member:iif([Paid]0,"YES","NO"), which would result in a column
called Member with a value of either Y or N depending on the value of
[Paid].

This cannot be done using adp/SQL. The query designer simply puts quotes
around the entire statement and outputs that. Please could you tell me
where
I can I find a useful reference guide that will tell me how to construct
computed columns in Access queries using adp/SQL?

Hi Ian,

There is no "IIF" in SQL Server,
one usually resorts to the CASE stmt

CASE WHEN condition THEN a ELSE b END

In grid of VIEW designer the "columns"
are "down" instead of "across" so "alias"
has its own column (instead of having to use
"alias: xxxx")

Columns
Alias
CASE WHEN [Paid]0 THEN "Yes" ELSE "No" END Member

I usually add CASE stmts last because designer
cannot reconcile its "Diagram" window (showing
all the tables and joins) with a CASE stmt, so you
no longer will get your "Diagram" window.

good luck,

gary


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.