Datagrid paging using dates?

L

Lynn

Hello,

I have a datagrid setup, and I have the records in the datagrid displayed by
a date range.

I would like to use some custom paging, but am unsure of how to get this to
work when the items are sorted by date.

Her is my SQL statement that is sued to populate my datagrid:SELECT EventID, sEventName, dtEventDate, iEventType, sCity, sState,
sWebSite, iApproved FROM tEventCalendar WHERE dtEventDate >= " &
DateTime.Now.ToOADate & " ORDER BY dtEventDate ASC, sEventName ASC",
connString
<<

I started by using this:SELECT EventID, sEventName, dtEventDate, iEventType, sCity, sState,
sWebSite, iApproved FROM tEventCalendar WHERE EventID BETWEEN " & i & " AND
" & i + dgEvents.PageSize & " AND dtEventDate >= " & DateTime.Now.ToOADate &
" ORDER BY dtEventDate ASC, sEventName ASC", connString
<<
but realized that this is sorting by i, which is my EventID. This is not
working.

Would I be paging using the date, or using something else?

I am new to this, and, well, confused.

Thanks for the help,

Lynn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top