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,784
  • 6
  • 24
  • 30

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,242,037
  • 58
  • 646
  • 786