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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:39:31+00:00 2026-06-05T23:39:31+00:00

I have the following problem. I wrote a query to get the date of

  • 0

I have the following problem. I wrote a query to get the date of an order in c#:

QueryDate = string.Format("(Order.Begin>= '{0}' and Order.End<= '{1}')", BeginDate, EndDate);

The problem is my SQL Server table columns, ‘Begin’ and ‘End’, are varchar columns and I want to keep them this way. They are saved as ’12-4-2012′ for example.

Now I want to get the dates between say ’12-4-2012′ and ’19-4-2012′. But the result is everything between ’12’ and ’19’ with the first 2 digits. So the results also include ’14-8-2011′ for example.

Is there a way retrieve only the dates between ’12-4-2012′ and ’19-4-2012′ with a string column?

  • 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-06-05T23:39:32+00:00Added an answer on June 5, 2026 at 11:39 pm

    I think you can convert the Begin and Order columns into DateTime format something like this:

    QueryDate = string.Format("(convert(datetime, Order.Begin, 105) >= @startdate and convert(datetime, Order.End, 105)<= @enddate;"

    And then add he @startdate, and @enddae parameters…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an interesting problem. I wrote the following perl script to recursively loop
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
I have the following problem in a Database using Access 2007 as front end
I have the following problem with an NHibernate query. one table LearnerDocuments : LearnerNumber
I have following problem: I have built a tabbar application with 4 tabs. I
I have the following problem: I have a form in site/banen (currently local running
I have the following problem. I have three classes, A, B and C. A
I have the following problem: I implemented a managed mobile application for Windows Mobile
I have the following problem that the standard library doesn't solve well, and I'm
I have the following problem: I got a view with two text fields and

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.