cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Saving Time field in SQL

Hello Everyone

 

I have two dropdowns controls one for hours (fieldname: Dropdownhour) and the other for minutes (fieldname: Dropdownminute)      I need to save these values in a SQL backend in a Time field called End_time.

I do not how to patch these two values together in the End_Time field 

Thank you to all of you that have read my query

 

Marco

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

@mpezzutti 

You can create a single 'time' type value from your dropdowns like this.

 

Time(
    Value(dropdownhour.Selected.Value),
    Value(dropdownminute.Selected.Value),
    0
)

 

Use it in a patch statement like this.

 

Patch(
    your_datasource_name,
    LookUp(your_datasource_name, ID = yourRecordID,
    Time(
        Value(dropdownhour.Selected.Value),
        Value(dropdownminute.Selected.Value),
        0
    )
)

 

Let me know if your SQL time field needs to follow any particular format or if this just works.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@mpezzutti 

I've edited the solution to include the Value() function now.  Whether its required depends on what data types are in the dropdown: Text or Number.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

View solution in original post

3 REPLIES 3
Super User III
Super User III

@mpezzutti 

You can create a single 'time' type value from your dropdowns like this.

 

Time(
    Value(dropdownhour.Selected.Value),
    Value(dropdownminute.Selected.Value),
    0
)

 

Use it in a patch statement like this.

 

Patch(
    your_datasource_name,
    LookUp(your_datasource_name, ID = yourRecordID,
    Time(
        Value(dropdownhour.Selected.Value),
        Value(dropdownminute.Selected.Value),
        0
    )
)

 

Let me know if your SQL time field needs to follow any particular format or if this just works.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Thank you so much this worked!

 

The only thing I had to do was put a value around the dropdown therefore 

, Time( Value(dropdownhour.Selected.Value), Value(dropdownminute.Selected.Value), 0 ) )

Other than that it worked

 

Thanks again !!

 

Marco

@mpezzutti 

I've edited the solution to include the Value() function now.  Whether its required depends on what data types are in the dropdown: Text or Number.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (8,837)