Skip to content

Invoke-DbaQuery on Date column returns : <date> 00:00:00 #7169

Answered by niphlod
MikeyBronowski asked this question in Q&A
Discussion options

You must be logged in to vote

whoppsie, forgot about this one. .net doesn't have a "Date" type, so what you get back is a datetime (with the time part truncated with zeroes). Simply put, there's no way to get a date back: if you want to see only the date part you can either format as a string in the query or format as a string the cell before displaying it.
Try this, same deal.

$a = get-date
$b = $a.date

$b is still a DateTime.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@MikeyBronowski
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MikeyBronowski
Comment options

@ghost
Comment options

Answer selected by MikeyBronowski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants