Selasa, 30 Juni 2015

Re: [MS_AccessPros] question about adding a column to a query

 

Hi Patty,

in the designer. click in an empty field cell

MyCalculatedFieldname: iif( nz([fieldname],"") <> "", value-if-true, value-if-false)

WHERE
[fieldname] is a text field -- if another data type, change optional second parameter of NZ

so, applying this to your data:

Diet Educ: iif( nz([fieldname],"") = "my specific result" , value-if-true, value-if-false)

hopefully you can draw an analogy to what you need

Warm Regards.
Crystal

Tool: Document Query Calculated Fields: Access to Excel. Music by JD Live (cc)
https://www.youtube.com/watch?v=vS8KfHU6L90
 - SQL to show calculated fields in queries, use CopyFromRecordset to put in Excel and then format


~ be awesome today ~

On 6/30/2015 12:19 PM, pattykf@cox.net [MS_Access_Professionals] wrote:

I am not sure this is possible or not but thought I would ask

I would like to pull in data from a table, then have it add a couple of columns so if say Diet is not blank(or has a specific result) it would put a 1 in the column field for Diet Educ, if Physical activity is not blank(or has a specific result) then it would put a 1 in the PA educ column and if they have both then it would put a 2 in the both educ column.


Is that possible and if so what is it called, or how would I write such a query?

Appreciate the help.

Patty


__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar