Porter, Mark
MPorter at acsalaska.com
Wed May 21 13:17:08 CDT 2003
I love the Switch function for queries. Combine it with a left() and you're in business. ! From Help----- Switch Function Example The following example uses the Switch function to determine the appropriate language for a specified city based on the values of the ShipCountry and ShipCity fields in an Orders table. You can enter the following expression in a calculated control on a form or report. The expression is shown on multiple lines for clarity; you can also enter it on a single line. = Switch([ShipCity] = "Madrid", "Spanish", _ [ShipCity] = "Berlin", "German", _ [ShipCity] = "Torino", "Italian", _ [ShipCountry] = "France", "French", _ True, "English") If the city is Madrid, the Switch function returns "Spanish"; if it is Berlin, it returns "German"; and so on. If the city is not one of those listed, but the country is France, it returns "French". If the city in question is not in the list, the Switch function returns "English". ----- Mark -----Original Message----- From: Gustav Brock [mailto:gustav at cactus.dk] Sent: Wednesday, May 21, 2003 7:02 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] does Access allow Replace in sql window ? Hi Oleg > but they are all different length (with first 5 characters being the same) If so: Expr1: IIf(Left([YourColumn], 5)='Masha', 'Masha', [YourColumn]) > Actually I just realisesd that all I need is for all values in that column > to be the word "associates" That should be simpler ? Ehh - you lost me here ... or do you mean: Expr1: IIf(Left([YourColumn], 10)='Associates', 'Associates', [YourColumn]) /gustav >> You could do something like: >> >> Expr1: IIf(Left([YourColumn], 4)='Mash', 'Masha', [YourColumn]) >> >> /gustav >> >> >>> I was pretty sure that it does, but I can't seem to remember/find how. >>> I need something like this >> >>> Edit tblTableName >> >>> Select * >> >>> Replace "Mash*" with "Masha" _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com This transmittal may contain confidential information intended solely for the addressee. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (collect at 907-564-1000) and ask to speak with the message sender. In addition, please immediately delete this message and all attachments. Thank you.