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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:01:23+00:00 2026-06-18T22:01:23+00:00

I worked with sql server 2008 and I used this command: SELECT Min(id), [idfromindex]

  • 0

I worked with sql server 2008 and I used this command:

SELECT Min(id), 
       [idfromindex] 
FROM   ordersview 
WHERE  [idfromindex] IN(SELECT DISTINCT [idfromindex] 
                        FROM   ordersview 
                        WHERE  isobserve = 'True' 
                               AND ispay = 'True' 
                               AND orderdate >= '1390/09/01' 
                               AND orderdate <= '1391/09/27') 
GROUP  BY [idfromindex] 

But if there is a record with exactly orderdate='1390/09/01' or orderdate='1391/09/27' value it will not show them ,it only shows the result greater and lower than them but I want to show the equal one too if it exists.

orderDate type is Date

  • 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-18T22:01:24+00:00Added an answer on June 18, 2026 at 10:01 pm

    Wouldn’t changing the condition to being >= '1390/09/01' and < '1391/09/28' make more sense? That way you remove the time components if a date is registered as being 1390/09/01 23:59'. Date conditions tend to assume the exact time is00:00`. Of course it depends on what your column datatype is (datetime vs. date).

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

Sidebar

Related Questions

I use this command to drop a table in sql-server 2008 IF EXISTS(SELECT name
I'm currently upgrading my sql server from 2005 to 2008 enterprise server. I used
I just upgraded from SQL Server 2008 to SQL Server 2008 R2. I went
I recently migrated a database from sql server 2005 to 2008 on windows server
Thanks to the people who answered my question this morning: SQL Server 2008: Count
I have not ever worked on triggers in SQL Server 2008. So I don't
We are migrating a database from SQL Server 2000 to SQL Server 2008 R2
I am converting an existing app from Sybase to SQL Server 2008. The app
Using SQL Server 2005 Database1 Table1 ID Date Status 001 23-02-2009 Worked 001 24-02-2009
I have the following situation: .net 3.5 WinForm client app accessing SQL Server 2008

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.