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  

Access Queries



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2004, 06:39 PM
Ruya
external usenet poster
 
Posts: n/a
Default Access Queries

I am working on a very detailed financial database and I am trying to balance
my numbers as I go. One of the queries that I need to write involves a rather
complex calculation. Based on different account numbers, I need to take one
number and subtract the other one from it. For example, I have some accounts
that start with a 175, some that start with a 155 and some with 70. How can I
write my query so that if the account number start with a "175" it should
subtract the corresponding "155" from it and if it doesn't it should just
give me the balance that's there. In Excel I can do this easily with a If and
Mid function, but I'm not sure how that would work in Access. Any help would
be much appreciated!!!! Thank you!
  #2  
Old August 18th, 2004, 01:41 PM
r. howell
external usenet poster
 
Posts: n/a
Default

Someone may have a more elegant solution, but if you made a column with IIF
so that your criterion is Account number starts with a 175, your "true part"
is 155 and your "false part" is 0 and then had a second column that
subtracted the IIF column from the account balance, that should do it.
Syntax for If-Then as IIF statement is discussed recently here.

"Ruya" wrote:

I am working on a very detailed financial database and I am trying to balance
my numbers as I go. One of the queries that I need to write involves a rather
complex calculation. Based on different account numbers, I need to take one
number and subtract the other one from it. For example, I have some accounts
that start with a 175, some that start with a 155 and some with 70. How can I
write my query so that if the account number start with a "175" it should
subtract the corresponding "155" from it and if it doesn't it should just
give me the balance that's there. In Excel I can do this easily with a If and
Mid function, but I'm not sure how that would work in Access. Any help would
be much appreciated!!!! Thank you!

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access License In Terminal Server JIM.H. General Discussion 9 July 19th, 2004 12:32 AM
SQL Server 2000 Stored Procedures to MS Access 2000 Queries CS General Discussion 4 July 15th, 2004 03:27 AM
Data Access Page Problem Doug Munich General Discussion 0 June 5th, 2004 12:03 AM


All times are GMT +1. The time now is 08:30 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.