cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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

Highlighted

@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
Highlighted
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

Highlighted

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

Highlighted

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (6,802)