0

When I order dates, sql puts nulls as the lowest value, but C# rdlc puts a null as the highest value. How do I solve it?

user1854438
  • 1,608
  • 5
  • 23
  • 29

1 Answers1

2

ANSI SQL and some databases support the NULLS FIRST/NULLS LAST keywords, just for this purpose.

Otherwise, you can use explicit logic in a SQL query:

order by (case when col is null then 1 else 2 end),
         col
Gordon Linoff
  • 1,198,228
  • 53
  • 572
  • 709