![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Update Query
I need to add an Account Title field to a database and I'm not sure how. The
account title would be based on the Account Number. So it would be something like if account number is 001 then account title = Cash. If account number is 002 then account title = deposits. Any suggestions? thanks! |
|
|||
|
Re: Update Query
In the field box of the query put something like:
AccountTitle: Iif(me.accountno="001","Cash",iif(me.accountno="00 2", "Deposits", etc. etc. Bonnie http://www.dataplus-svc.com Bookmdano wrote: >I need to add an Account Title field to a database and I'm not sure how. The >account title would be based on the Account Number. So it would be something >like if account number is 001 then account title = Cash. If account number is >002 then account title = deposits. > >Any suggestions? thanks! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ccess/200808/1 |
|
|||
|
RE: Update Query
first add the new field to the table
then it depends on how you want to populate that new field you may indeed want a one time query with an iif statement to create the data in order to apply to existing records if you are not familiar with iif statement - search on it in this site you will find lots of examples at the same time you might want to add this new field to a form so it gets entered as data gets entered for new records being made -- NTC "Bookmdano" wrote: > I need to add an Account Title field to a database and I'm not sure how. The > account title would be based on the Account Number. So it would be something > like if account number is 001 then account title = Cash. If account number is > 002 then account title = deposits. > > Any suggestions? thanks! |
|
|||
|
Re: Update Query
On Aug 12, 7:17*am, Bookmdano <Bookmd...@discussions.microsoft.com>
wrote: > I need to add an Account Title field to a database and I'm not sure how. The > account title would be based on the Account Number. *So it would be something > like if account number is 001 then account title = Cash. If account number is > 002 then account title = deposits. > > Any suggestions? *thanks! Create a table of (AccountNumber, AccountTitle) If AccountNumber is just a prefix (first n characters of the field), you could use a theta join instead of an inner join. INNER JOIN: SELECT t1.AccountNo, t2.AcountTitle,... FROM t1 INNER JOIN t2 ON LEFT(t1.AccountNo,3)=t2.AccountPrefix ... |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|