IT Services & Technology Solution Services

IT Services  YITTBOX
Create an account and receive a discount code for any future services!
Get Discount Code Now

Get IIF statement from field

9/29/2019 7:31:06 AM
admin
3 Comments
I have inherited a database that has a number of queries that have fields defined like:
IIf(IsNull([Table1.Field1]), 0, [Table1.Field1]) AS [New Field Name]
Your code will only return the “New Field Name” portion (ie: the field name). Is there a way to get the underlying “IIf…..” statement from the field?
Thanks in advance.

3 responses

RMurphy@YittBox.com 10/7/2019 2:21:10 PM
I'm not sure I understand this question; First, instead of the "IIF" function, I would use the "Nzz" custom function (which can be found via the "VBA Reference Library" in the YittBox Free Code section). 
test 10/10/2021 11:39:52 PM
mmmmm
 *
 *
 *
 
neo.fathur 10/15/2019 8:34:24 PM
Hello. Can you kindly clarify which code you're referring to? If you want to extract SQL string from a query in your database, you could use code below:
     CurrentDB.QueryDefs("YourQueryName").SQL
Furthermore, if you want to extract only the SELECT statement, you could utilize GetWordsBetween procedure (which can be found via the "VBA Reference Library" in the YittBox Free Code section) like:
     GetWordsBetween(CurrentDB.QueryDefs("YourQueryName").SQL,"SELECT ","FROM ")
Please let us know whether it answered your question. T.Hanks
Username 6/12/2020 11:54:57 PM
testing testing testing testing
 *
 *
 *
 
12/19/2022 11:23:55 PM
test
 *
 *
 *
 

Leave a Reply

Your email address will not be published. Required fields are marked

 *
 *
 *
 
Back
Let’s Work together

Start your Project

Loading