cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpezzutti
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
mdevaney
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
mdevaney
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (70,299)