Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2007

Tip: Looking for answers? Try searching our database.

Calculated field using IF statements in the Query Grid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter - 29 Dec 2007 10:29 GMT
8:23 PM 29/12/2007

I am only a new MS Access user and so I would like some help, please, in
solving this problem using the Access Query grid.  

I have an Access 2003 file with two fields as follows:

Field_1     Field_2
3    ..
1    ..
2    ..
1    ..
3    ..
2    ..
2    ..
3    ..
2    ..

My objective is to make Field_2 a calculated field by running a query that
recognises the value of Field_1 and allocates a text string according to a
simple rule.  The rule is as follows:  
A value of 1 in Field_1 stands for "marigold";
A value of 2 in Field_1 stands for "sunflower"; and
A value of 3 in Field_1 stands for "rose".  

So, using my yet-to-be-formulated query, Field_2 would look like this:

Field_1     Field_2
3    rose
1    marigold
2    sunflower
1    marigold
3    rose
2    sunflower
2    sunflower
3    rose
2    sunflower

If I was using Excel, I would solve the problem using the IF function.  For
example (assuming Field_1 in Access was Col A in Excel and Field_2 was Col B
in Excel),
I would put the following formula in Col B in the first row and copy it
down the colum:
=IF (A1=1, "marigold", IF (A1=2, "sunflower", IF (A1=3, "rose",)))

Knowing Microsoft, the Excel formula above should translate fairly closely
into MS Access but I do not know how to actually phrase it in the Query grid.
The query grid thingy is a little unweildy for me at my current stage of
learning about Access.

Could someone please help me?

Signature

Peter

Barb Reinhardt - 29 Dec 2007 12:29 GMT
You may get a quicker reply if you post this to an Access users group.
Signature

HTH,
Barb Reinhardt

> 8:23 PM 29/12/2007
>
[quoted text clipped - 47 lines]
>
> Could someone please help me?
Peter - 29 Dec 2007 12:35 GMT
oops i am so sorry. i thought i did. pls accept my apology.
Signature

Peter

> You may get a quicker reply if you post this to an Access users group.
>
[quoted text clipped - 49 lines]
> >
> > Could someone please help me?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.