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 7573353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:09:39+00:00 2026-05-30T16:09:39+00:00

The following code doesn’t appear to run when executed by code: Stored procedure snippet:

  • 0

The following code doesn’t appear to run when executed by code:

Stored procedure snippet:

Click to view full SP

 AND (@month_ref = 81201 
      AND tsks.grouping_ref = @grouping_ref 
      AND ts.start_dtm BETWEEN convert(datetime, '2011-11-28') 
                           AND convert(datetime,'2012-01-01')
     )
  OR (@month_ref = 81202 
      AND tsks.grouping_ref = @grouping_ref 
      AND ts.start_dtm BETWEEN convert(datetime,'2012-01-02') 
                           AND convert(datetime,'2012-01-29')
     )...

Server setup:

SQL Server is setup as:

  • Language: English (United States)

And Windows Server region and language are set to:

  • English (United States)

Our test server is set up for British English and the stored procedure appears to work just fine. I have a feeling the customer setup doesn’t like the dates.

DB design / data

ts.start_dtm looks like this in the database:

  • datatype – datetime

    2011-04-01 00:00:00.000
    

So its setup as – YEAR | MONTH | DATE

My stored procedure is hardcoding the start_dtm as '2012-01-02' which is also in the same format.

Can you help me please?

The problem is the website fails when it tries to run the stored Procedure. The issue was the data conversion. I had to assign the format of date conversion.

  • 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-30T16:09:40+00:00Added an answer on May 30, 2026 at 4:09 pm

    You shouldn’t need an explicit conversion on the dates at all. This is ISO8601 format, so the database should understand it straight off:

    ts.start_dtm Between '2011-11-28' AND '2012-01-01'
    

    If you need to convert them, specify what format you are using for the strings:

    ts.start_dtm Between convert(datetime,'2011-11-28', 120) AND convert(datetime,'2012-01-01', 120)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code doesn't give any error but my view isn't displaying anything. Can
The following code doesn't appear to work properly for me. It requires starting a
following code doesn't work with input: 2 7 add Elly 0888424242 add Elly 0883666666
The following code doesn't compile with gcc, but does with Visual Studio: template <typename
The following code doesn't work! 'this' in in the context when i access it
Any idea why the following code doesn't print the amount of characters in the
I know why the following code doesn't compile: public class Main { public static
I'm wondering why the following code doesn't work: String test = new String(new byte[]
Setting onchange event for CheckBoxList using the following code doesn't work. chkListUserGroup.Attributes.Add(onchange, document.forms[0].isRecordModified.value='true';); How
I'm having a hard time understanding why the following code doesn't work. I'm sure

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.