web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Date Time combine save...
Power Apps
Unanswered

Date Time combine save into SQL

(0) ShareShare
ReportReport
Posted on by 494

Hi Guys,

 

Do you know how to combine datepicker and time to save into the database as one?

dateTime.PNG

Categories:
I have the same question (0)
  • Verified answer
    seadude Profile Picture
    1,855 on at

    Hi @Big_S . It depends on what data type the SQL field is. String? Numeric? Datetime? Datetime2?

    Try a combination of the Concatenate and Text functions. Also check out the DateTimeValue function.

    Something like:

    Text(
     Concatenate(
     Text(datepicker.SelectedDate), 
     ddHour.Selected.Value, 
     ":", 
     ddMinute.Selected.Value
     ), "mm/dd/yyyy hh:mm:ss"
    )

    Also, we have a lot of fun with Time in the forums here. Search the forum for "Time after time" or "Time to party" for some really good examples of Time functions.

    Good luck!

  • Big_S Profile Picture
    494 on at

    Hi @seadude 

    This is my table design im using time as data type how to apply your formula on this? 🙂

    table.PNG

  • Verified answer
    seadude Profile Picture
    1,855 on at

    Hi @Big_S ,

     

    Aha. This changes things a bit. It looks like you have one DataCard/Group with three values (date, hour, minute)(?).

    - Use Concatenate Function to combine Hour/Min dropdowns along with the ":"

    - Use Text Function to convert the combined text to time(7) format

    - Then patch this value to each Time column accordingly

    - You might also experiment with the PowerApps Time Function 

    - I don't think there would be anything special required for Patching the Datepicker date.

     

    You might also consider combining the date and time columns into a single:

    I dont' directly use time(7) in SQL but rather datetime(2) then parse things on the display/analysis end to peel out times as needed. I also like datetimeoffset. It basically holds users local time, UTC, and timezone all in a single column.

     

    Again, might be 1/2 dozen of one 6 of the other as you may have to parse these on the display/analysis end (data visualization) to compare certain values.

    Good luck!

  • Big_S Profile Picture
    494 on at

    THANK YOU SO MUCH! @seadude  🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard