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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:03:44+00:00 2026-06-15T16:03:44+00:00

Hi guys i have a table expenses with multiple records. expenseID ratename description workcompleted

  • 0

Hi guys i have a table expenses with multiple records.

expenseID       ratename         description            workcompleted

51699           Base Rate        SNL Financial inquiry  08/09/2011
51699           Base Rate        SNL Financial inquiry  08/19/2011
51699           Base Rate        SNL Financial inquiry  08/09/2012
51699           Base Rate        SNL Financial inquiry  08/19/2012

But when i search record only for year 2012 but it return record for both the year(2011, 2012). But I need my record comes by year only i.e.

expected results:

51699   Base Rate   SNL Financial inquiry   08/09/2012
51699   Base Rate   SNL Financial inquiry   08/19/2012

Please see my query :

select expenseid,ratename,description,workcompleted from EXPENSES 
where workcompleted >= '08/08/2012' and workcompleted <= '08/19/2012'

I also try this by using between query but it doesn’t work. If any body have an idea kindly share to me.

  • 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-15T16:03:45+00:00Added an answer on June 15, 2026 at 4:03 pm

    You’re almost certainly using the wrong data type. Your column “work_completed” should be of type date. It’s almost certainly char or varchar. Your best bet is to change the data type.

    If you can’t do that, you can create a view that mirrors the table, but casts the “work_completed” column to a date type. Querying a date range against such a view should work correctly.

    If you can’t create views, you can change your WHERE clause to do the cast. In standard SQL, it would look like

    WHERE CAST(workcompleted AS DATE) >= '2012-08-08' 
      AND CAST(workcompleted AS DATE) <= '2012-08-19'
    

    I know SQL Server supports CAST(), but you’ll probably have to go with your original format for the dates (like ’08/08/2012′).

    Expect a performance hit if you do that. SQL Server will have to do two type casts on every row.

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

Sidebar

Related Questions

Hi Guys I have a table with Multiple column and rows my First Column
Hi Guys I currently have this table MEMBER **ID Position Latitude Longitute** 1 1
Do you guys have some tips to make any large table, with 500+ rows,
Hi guys I have a table like that? <table> <colgroup> <col class=selected> <col> </colgroup>
Hi Guys I have One table that Stores Student Scores for Different Subjects in
I have this table: id | owner | asset | rate ------------------------- 1 |
Hi Guys I have two tables table B has a many to 1 relationship
Guys i have to do a insert in to a table when there is
Hey guys, I have a question about asp.net I have this table with checkbox
Hello guys have a div that is outside of a table and I want

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.