I have a table which has a field ItemsReceived of type datetime. I
have a grid view which has two columns.

In first column i have to show the data from field ItemsReceived and
in second column I have to show
difference between Currenttime and date from ItemReceived. How can I
do that.

Hi,
you can give a shot like this;

1) create a sql query;

select itemreceived, datediff(hh,itemreceived,getdate())[diff] from <tablename>

This will give you the date and diff values.

2) Bind this query output to the gridview datasource.

The output will have both the values in grid.

Let us know if this helps;

Thank you,

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.