hello

i want to read 12 values (datetime data type) named s1,s2,s3,s4....,s12 from database.

compare these 12 fields with current date. if difference lies between 10 days i want to show corrosponding result.

please tell me code for this in c#

Hello

in principle, it goes that way

select yourData from yourtable
  where datediff (day, s1, now()) <= 10;

Now it's your turn to put some c# code around the sql statement.

You may show your result for further discussions.

-- tesu

Hello

in principle, it goes that way

select yourData from yourtable
  where datediff (day, s1, now()) <= 10;

Now it's your turn to put some c# code around the sql statement.

You may show your result for further discussions.

-- tesu

i want to check date difference between current date and one of the 12 columns named s1,s2,s3,s4,....,s12.

if difference between current date and one of the 12 columns lies between 10 days then i want to show corrosponding result

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.