Home All Groups Group Topic Archive Search About

Calculations with DateTime fields using DataColumn.Expression stri

Author
7 Dec 2004 4:17 AM
Matt
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

Author
31 Dec 2004 6:03 PM
Don Mackenzie
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
Are all your drivers up to date? click for free checkup

Author
2 Jan 2005 6:19 AM
Morgan Vermef
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

Bookmark and Share