Search between two dates and show results - gridview

I have a gridview and sqldatasource.

Here is the gridview:

    +----+--------------+--------+----------+
    | No |  Names       |   ID   |  Date    |
    +----+--------------+--------+----------+
    |  1 |  Name1       |1636    |04.15.2012|
    |  2 |  Name7       |1236    |09.12.2012|
    |  3 |  Name1       |1136    |08.16.2012|
    |  4 |  Name3       |1536    |09.25.2012| 
    |  5 |  Name11      |1436    |09.15.2012|
    |  6 |  Name1       |1836    |09.11.2012| 
    |  7 |  Name2       |1736    |09.15.2011|
    |  8 |  Name1       |1296    |08.15.2012| 
    +----+--------------+--------+----------+

And now I'm searching Name1 in Names and show all rows that are between first date and final date

  Names : [Name1]
    First date : [08.01.2012]
    Final date : [09.30.2012] 
                 [[SEARCH]]

Results will be:

+----+--------------+--------+----------+
| No |  Names       |   ID   |  Date    |
+----+--------------+--------+----------+
|  3 |  Name1       |1136    |08.16.2012| 
|  8 |  Name1       |1296    |08.15.2012| 
|  6 |  Name1       |1836    |09.11.2012| 
+----+--------------+--------+----------+

I don't know how to make this , can someone help me if he wouldn't mind?

Thank you, Jax

Answers


select *
from your_table
where name='Name1' and Date between 'First date' and 'Final date';

you can use the sql query for solving this and the query is

   select NO,Names,ID,Date from [your table] where Names='Name1' and Date Between FirstDate and SecondDate

Hope this will help you..


Use this following query if datatype of First Date and Final Date is DateTime

SELECT 
   NO,Names,ID,Date 
FROM 
   [Table Name] 
WHERE 
   Names = 'Name1' AND
   Date BETWEEN FirstDate AND SecondDate

If you are passing the First Date and Final Date as string , then you need to convert them to DATE data type and use in query as follows.

SELECT 
   NO,Names,ID,Date 
FROM 
   [Table Name] 
WHERE 
   Names = 'Name1' AND
   CONVERT(DATE,[Date],101) BETWEEN CONVERT(DATE,FirstDate,101) AND    
   CONVERT(DATE,SecondDate,101)

Need Your Help

Quartz scheduler Not Working after exception [java.lang.IllegalStateException: HttpSession is invalid]

java exception weblogic scheduled-tasks quartz-scheduler

I am currently working with Quartz scheduler in my web application to schedule a task after running the server and then repeat it in regular interval.

Save Dojox GFX Canvas as SVG

svg dojo gfx

Is there a way to serialize a Dojox GFX canvas as SVG?