Access Formulae

V

Varne

Hi!

I know something in Excel but I want to know something about writing queries
in Access. I seek some introduction.

I have created an Access table and recorded the following query;

SELECT [Source Data].[Target PI], [Source Data].[Fixed Hours]
FROM [Source Data];

I want to have the third column. In it I want to have values =Fixed
Hours/Target PI if Fixed Hours is more than 50.

Could someone help me!

Thank You.
 
M

MGFoster

Varne said:
Hi!

I know something in Excel but I want to know something about writing queries
in Access. I seek some introduction.

I have created an Access table and recorded the following query;

SELECT [Source Data].[Target PI], [Source Data].[Fixed Hours]
FROM [Source Data];

I want to have the third column. In it I want to have values =Fixed
Hours/Target PI if Fixed Hours is more than 50.

Could someone help me!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try this:

SELECT [Source Data].[Target PI], [Source Data].[Fixed Hours],

IIf([Fixed Hours]>50,[Fixed Hours]/[Target PI],Null) As PctOfTargetPI

FROM [Source Data];

Use the IIf() function in Access - same as Excel's IF() function.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSTmXNoechKqOuFEgEQLGngCg9HKPBr4ZM6X7l8uiMmb9XXmqTAsAnRNT
g0aSn5OfTfgtUnjoRRwk9N0u
=2Jhg
-----END PGP SIGNATURE-----
 
V

Varne

Hi!

Have managed to work it out with Microsoft Access 200 reference;

SELECT [Source Data].[Target PI], [Source Data].[Fixed Hours], [fixed
hours]/[target pi]*100 AS Expr1
FROM [Source Data]
WHERE ((([Source Data].[Fixed Hours])>50));
 
V

Varne

Hi!

That is what I required. Before seeing your reply I posted my second one.

Many thanks.

MGFoster said:
Varne said:
Hi!

I know something in Excel but I want to know something about writing queries
in Access. I seek some introduction.

I have created an Access table and recorded the following query;

SELECT [Source Data].[Target PI], [Source Data].[Fixed Hours]
FROM [Source Data];

I want to have the third column. In it I want to have values =Fixed
Hours/Target PI if Fixed Hours is more than 50.

Could someone help me!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try this:

SELECT [Source Data].[Target PI], [Source Data].[Fixed Hours],

IIf([Fixed Hours]>50,[Fixed Hours]/[Target PI],Null) As PctOfTargetPI

FROM [Source Data];

Use the IIf() function in Access - same as Excel's IF() function.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSTmXNoechKqOuFEgEQLGngCg9HKPBr4ZM6X7l8uiMmb9XXmqTAsAnRNT
g0aSn5OfTfgtUnjoRRwk9N0u
=2Jhg
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top