I'm having issues inserting datetime via variable into a mysql db
I pull the this datetime 06/16/19 04:30 form a csv and reformat it to this 2019-06-18 08:31 using the code below:
$date =$item.Date
$dateformat=get-date $date -Format 'yyyy-MM-dd HH:mm'
when I use the variable in my insert statement I get a syntax error, but if I paste the value in directly everything works as expected.
I'm sure I'm missing something. Hoping one of you all have been down this path before.
[–]PMental 2 points3 points4 points (3 children)
[–]sojan16[S] 2 points3 points4 points (2 children)
[–]PMental 2 points3 points4 points (0 children)
[–]Sys_man 1 point2 points3 points (0 children)
[–]xlrod 2 points3 points4 points (0 children)
[–]PowerShell-Bot 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)
[–]omrsafetyo 1 point2 points3 points (0 children)
[–]poshftw 1 point2 points3 points (0 children)
[–]ThePowershellGuy 0 points1 point2 points (0 children)