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

The Archive Base Latest Questions

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

Trying to search between two dates to only get certain rows . A 7

  • 0

Trying to search between two dates to only get certain rows. A 7 day search.

   @date = DateTime.Today
   @date2 = //need it to be the prior 7 days

SelectCommand = "SELECT [DateReceived], [DeviceLevel] FROM [TBLReadings] WHERE [DateReceived=@date] <= [DateReceived=@date2] ORDER BY [DateReceived] DESC;

This is wrong but I hope it explain what I am trying to do – only ever used PHP and MySQL.

  • 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-05T05:54:41+00:00Added an answer on June 5, 2026 at 5:54 am

    if you are trying to search between 2 dates, you can use between

    the query will be something like

    select [dateRecieved], [DeviceLevel] from YourTable where DateReceived between @date and @date2 ORDER BY [DateReceived] DESC
    

    in c#, to get 7 days you can use Datetime.Now.AddDays(7)

    http://msdn.microsoft.com/en-us/library/system.datetime.adddays.aspx

    sorry for the bad english!

    edit: that’s only the query, use it as a string in the select command

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

Sidebar

Related Questions

Today i'm trying to pass a variable between two datagrids. The first is on
I'm trying to remove the margin between the search bar and the Go! button
Im trying to search two of the fields in my table. (Database table contains
I am trying to implement a fulltext search on two columns which I created
I am trying to build a search page and alignment is correct between search
Trying to get searching working on Heroku using partial search The following query generates
I am trying to find a path between two nodes in a graph ,
I want to use Lucene.NET for fulltext search shared between two apps: one is
I'm trying to build a regular expression that matches regular expressions between two forward
I'm trying to perform a baseless merge between two branches using tf.exe. When I

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.