|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Calculations with DateTime fields using DataColumn.Expression striI am trying to add Expression columns to a DataGrid that perform calculations
using other DateTime fields in the Grid. It appears from the MSDN library docs that DataColumn.Expression syntax allows you to compare date fields using < > and convert them to strings, but nothing else that I can find. Is there a way to use custom built functions in Expressions, convert DateTime values to numeric values within the Expression string, or an alternative to using Expression? The simple problem I'm experimenting with is to create an HoursWorked column based on 2 "Short Time" DateTime columns : ShiftEndTime - ShiftStartTime. I would ultimately like a way to perform all functionality normally available to DateTime objects. Any help much appreciated. Matt I am using VB.NET 2003 Std with an OledbConnection to an Access .mdb file Matt,
Have you figured this out or gotten a response? I need to do the same thing -- I want to subtract two dates and get the number of days between them. It seems like an obvious thing to do but I can't find a reasonable way to do it. Don Show quoteHide quote "Matt" wrote: > I am trying to add Expression columns to a DataGrid that perform calculations > using other DateTime fields in the Grid. It appears from the MSDN library > docs that DataColumn.Expression syntax allows you to compare date fields > using < > and convert them to strings, but nothing else that I can find. Is > there a way to use custom built functions in Expressions, convert DateTime > values to numeric values within the Expression string, or an alternative to > using Expression? > > The simple problem I'm experimenting with is to create an HoursWorked column > based on 2 "Short Time" DateTime columns : ShiftEndTime - ShiftStartTime. I > would ultimately like a way to perform all functionality normally available > to DateTime objects. > > Any help much appreciated. > > Matt > > I am using VB.NET 2003 Std with an OledbConnection to an Access .mdb file Matt & Don
I think you looking for something in like this http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q904q Show quoteHide quote "Don Mackenzie" <DonM@nospam.nospam> wrote in message news:3707B2F1-D478-4B71-97AA-4BE26C6FE8D4@microsoft.com... > Matt, > > Have you figured this out or gotten a response? I need to do the same > thing > -- I want to subtract two dates and get the number of days between them. > It > seems like an obvious thing to do but I can't find a reasonable way to do > it. > > Don > > "Matt" wrote: > >> I am trying to add Expression columns to a DataGrid that perform >> calculations >> using other DateTime fields in the Grid. It appears from the MSDN >> library >> docs that DataColumn.Expression syntax allows you to compare date fields >> using < > and convert them to strings, but nothing else that I can find. >> Is >> there a way to use custom built functions in Expressions, convert >> DateTime >> values to numeric values within the Expression string, or an alternative >> to >> using Expression? >> >> The simple problem I'm experimenting with is to create an HoursWorked >> column >> based on 2 "Short Time" DateTime columns : ShiftEndTime - ShiftStartTime. >> I >> would ultimately like a way to perform all functionality normally >> available >> to DateTime objects. >> >> Any help much appreciated. >> >> Matt >> >> I am using VB.NET 2003 Std with an OledbConnection to an Access .mdb file
Other interesting topics
MOD Operator
Add result using EnumWindow/GetWindowText ListBox problem Table in a Windows Application How to get a file's date/time correctly? I need to run a vb.net or aspx.net file every 10 seconds. Threads with Windows. Tabbing to next field after Return key return errorlevel from winform Moving from VB6 to Visual Studio.NET |
|||||||||||||||||||||||