tsql query for date

arkiboys 9,686 Reputation points
2023-10-30T17:13:26.3833333+00:00

in table there are columns for

_year _month _day

i.e

2023 09 01

question,

how can I write the sql like this:

select...where _year_month_day < '2023-8-12'

thank you

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,053 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 113.7K Reputation points
    2023-10-30T19:14:21.4933333+00:00

    Try: where datefromparts(_year, _month, _day) < '2023-8-12'.