Results 1 to 5 of 5

Thread: [RESOLVED] isnullorwhitespace?

Threaded View

  1. #3

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: isnullorwhitespace?

    I guess. The date is always represented as a string I have to cast.
    The values are NULL, '' or longstring. The ideal would be an existing isnullorwhitespace as in .net but there is non in SQL.

    Edit.
    After more careful evaluation what I'm using may break sargability on an already non sargable CAST , so a more sargable select might be:

    Code:
      case when (person_suburb is null or DATALENGTH(person_suburb) <=0) THEN NULL
      ELSE Cast( SUBSTRING(person_suburb,Charindex('FD',person_suburb)+5,8) as date) END as Firstdate
    Last edited by sapator; Apr 29th, 2024 at 09:12 AM.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width