cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevinsray
Level: Powered On

If Lookup on multiple columns

I would really appreciate some help.

I have a table in SQL DB with a FLE_Name column which is varchar and FLE_Date column which is datetime.

There is mulitple values in FLE_Name (Yoda, R2D2, Hans, ETC) and multiple dates in FLE_Date column.

I am trying to do an If(Lookup(.. on this table.

I want to return true if FLE_Name = Yoda and FLE_Date is today`s date.

This will be in the "Visible" properties of a button.

So that if a record for Yoda with today`s date is present, the If will do the True.

Anyone have any idea how I could do this?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: If Lookup on multiple columns

Hi @kevinsray

You should be able to do this by setting the Visible property of your button to the following formula:

(CountIf('[dbo].[YourTable]', FLE_Date = Today() && FLE_Name="Yoda") = 0)

This formula will resolve to true when FLE_Name = Yoda and FLE_Date = Todays date.

Note that if Today() returns the current date with a time element of midnight. Therefore, it'll match only those records in your table where the time element of FLE_Date is also midnight.

View solution in original post

kevinsray
Level: Powered On

Re: If Lookup on multiple columns

Hey Mate,

Did some more work on this and was able to get it working as I want.

This is the code I ended up with in the Visible property.

 

(CountIf('[dbo].[WHS_FL_EL]', Text(DateAdd(FLE_Date,-0,Hours),"[$-en-US]dd/mm/yyyy") = Text(Today()) && FLE_Name="Yoda") = 0)

 

Thank you so much for the pointer.

Now I have another function I sort of know how to use. 

View solution in original post

3 REPLIES 3
Super User
Super User

Re: If Lookup on multiple columns

Hi @kevinsray

You should be able to do this by setting the Visible property of your button to the following formula:

(CountIf('[dbo].[YourTable]', FLE_Date = Today() && FLE_Name="Yoda") = 0)

This formula will resolve to true when FLE_Name = Yoda and FLE_Date = Todays date.

Note that if Today() returns the current date with a time element of midnight. Therefore, it'll match only those records in your table where the time element of FLE_Date is also midnight.

View solution in original post

kevinsray
Level: Powered On

Re: If Lookup on multiple columns

Thank you for this feedback.

How could I modify this so that it checks the datetime stamp for any time during a day.

As some of the datetime stamps may be morning, while others may be afternoon.

kevinsray
Level: Powered On

Re: If Lookup on multiple columns

Hey Mate,

Did some more work on this and was able to get it working as I want.

This is the code I ended up with in the Visible property.

 

(CountIf('[dbo].[WHS_FL_EL]', Text(DateAdd(FLE_Date,-0,Hours),"[$-en-US]dd/mm/yyyy") = Text(Today()) && FLE_Name="Yoda") = 0)

 

Thank you so much for the pointer.

Now I have another function I sort of know how to use. 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,101)