cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shubh-MacMiller
Frequent Visitor

Problem displaying DateTime object from SQL database

Hello Powerapps Community,

 

I am having trouble displaying a datetime object from a sql server in a text label on my powerapps application.

 

There is however another object of same datetime type which shows up in the powerapp just fine.

The object which shows up fine is called DateFabTarget. The one which does not but is of the same type is called DateRequired. The datetime object that cannot be displayed (dateRequired) is not null as I have verified by looking at the sql table for multiple cases.

 

Any idea as to why two of the same object types would not show up on powerapps in a text label from an sql table which has data for both of them?

 

Thank you,

Shubh

 

9 REPLIES 9
v-monli-msft
Community Support
Community Support

Hi Shubh,

 

 

Did you make sure that these 2 have exactly the same datetime type in SQL? Also, were they from the same table data source in PowerApps? Some screenshots might help to understand better.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Mona,

 

Both the DateFabTarget and DateRequired data types are DateTime. 

 

Here is one row of data from the sql table that holds both DateFabTarget and DateRequired:

{
"Barcode": 342237,
"DateReceived": "2017-06-16T00:00:00Z",
"DateRequired": "2017-06-22T00:00:00Z",
"DateFabTarget": "2017-06-20T14:30:00Z",
"Lbs": 2.63,
"Pallet": "1A"
},

 

Currently in the powerapp, DateFabTarget shows up correctly, but DateRequired does not show up at all.

Here is a screenshot of the application showing the datefabtarget but not daterequired:

Capture.PNG

I have double checked the the label I am using to show fabtargetdate and daterequired are both the same, and the text is correct as well. It just seems that for some reason, DateRequired will not show up.

 

Shubh

As Mona said, a screenshot is worth a thousand words. Please supply one of the formula for the label.

Hey Andy,

 

Here is a screeshot of the formula for the DateRequired:1.PNG

And here is one for DateFabTarget:

2.PNG

Please ignore the first couple values that are showing up as blank. I have verified that for multiple items on the table below the first couple ones, the DateRequired is not showing up even though it does show up on the SQL table, '[SDC].[ShobFabTracking}'.

 

Thanks,

Shubhankar Singh

From what I can see, DateFabTarget is not actually a DateTime object. What happens if you just display it directly in this label?

If the DateFabTarget is displayed directly into the label, it just changes the time to an incorrect time. Otherwise, it still displays the DateTime in the label. 

 

1.PNG

I still think its a string type. Wrap it with the DateValue function in both places in your formula.

Hey Andy,

 

Thank you for youre continued help with this situation. I went ahead and wrapped the DateRequired with the function and still had no date show up. Here is a screenshot:

Capture.PNG

Again I have verified that the value does exist in the sql data table.

 

Shubh

akhtarmiah
Frequent Visitor

If you are still have issues with datetime inconsistency between SQL Table and the PowerApps Value please convert the table column from datetime to datetimeoffset(7).

 

hope this helps

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,437)