Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6216133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:10:46+00:00 2026-05-24T07:10:46+00:00

Is there a way in SQL Server using T-SQL to say: WHERE CONVERT(date, mat1_04_05,

  • 0

Is there a way in SQL Server using T-SQL to say:

WHERE CONVERT(date, mat1_04_05, 101) = true

I’m doing some reporting against an app that I don’t have source for and the column is varchar and I can’t rely on user data.

EDIT

I tried using ISDATE. However I’m still running into a conversion error this is the full query:

SELECT mat1_04_01                                    AS 'CaseStg',
       matter.mat_no                                 AS 'MatNo',
       MAX(matter.client)                            AS 'Client',
       MAX(mat1_03_01)                               AS 'InCo',
       MAX(mat1_07_01)                               AS 'Clm Amt',
       MAX(mat1_07_03)                               AS 'Clm Bal',
       MAX(mat1_04_05)                               AS 'BilSnt',
       MAX(mat1_01_07)                               AS 'Injured',
       CONVERT(CHAR, MIN(CONVERT(DATE, usr1_02_01))) AS dos_start,
       CONVERT(CHAR, MAX(CONVERT(DATE, usr1_02_02))) AS dos_end
FROM   lntmuser.matter
       INNER JOIN lntmuser.usertype1
         ON lntmuser.matter.sysid = lntmuser.usertype1.mat_id
WHERE  Isdate(mat1_04_05) = 1
       AND Datediff(DAY, CONVERT(DATE, mat1_04_05, 101), Getdate()) > 31
       AND mat1_04_01 LIKE 'BILLING MAILED OUT'
       AND matter.status NOT LIKE 'CLOSED'
GROUP  BY mat1_04_01,
          matter.mat_no  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:10:46+00:00Added an answer on May 24, 2026 at 7:10 am

    Dude — it doesn’t make sense to use ISDATE() and CONVERT() on the same date field in your WHERE without a control structure. I.e., if ISDATE() = false, then CONVERT() is guaranteed to give you a conversion error.

    Try this:

    WHERE
    ...
    CASE WHEN ISDATE(myDateField) = 1 THEN DATEDIFF(CONVERT(...)) ELSE 0 END > 31
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SQL Server 2008, is there a way to allow inserts to a table
Using Microsoft SQL Server 2005, is there any way to see when a table
is there some way to tell sql server to use the (nolock) hint or
Using Microsoft SQL Server 2008, let's say there is a table1 that keeps the
Is there a way to define a constraint using SQL Server 2005 to not
Is there a way in sql server 2008 to delete #tt using a string:
Is there a way in SQL Server to list all the views within a
Is there a way to tell SQL server to use specific default seed value
IN SQL Server 2008 is there a way to generate a report as to
Is there any way to add a SQL Server Database Diagram to source control?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.