Solved

Calculating the number of minutes in a DataColumn.Expression

Posted on 2008-10-03
2
418 Views
Last Modified: 2012-05-05
Hi Experts.
I use an ODBC connection to a Lotus Notes DB. I can get the value fields from a view in a DataTable, but not the formula fields. Therefore I need to make a similar expressions in a column in the DataTable to have the same values. I use the DataColumn.Expression method. This works fine except for one column where I need to convert time to the number of minutes.

When I import from Lotus Notes the column displays the time as 01:25 or 1:25 (I checked that it is indeed a datatime column). What I need to do is convert the time to a number of minutes. Does someone know / have an expression to do this?

Best regards, Mark
0
Comment
Question by:mark_norge
2 Comments
 
LVL 2

Assisted Solution

by:madivad2
madivad2 earned 200 total points
ID: 22632530
how is the data stored in the database? perhaps it is already in minutes or something similar. Instead of having your column set as date/time, maybe set it as number or text and read the raw value out.

I don't know how this data is stored in lotus notes, but say for example it is stored as 85, then when you cast it to a date/time value, it may be converting it to 1:25
0
 

Accepted Solution

by:
mark_norge earned 0 total points
ID: 22632550
Thanks for your reply and unfortunately not. Since the formula was getting to hard to read with the limited options you have with the DataColumn.Expression, I have created a workaround.

I now loop through the DataTable and calculate the missing values. It works and I will probably keep it like this unless someone comes up with a very simple conversion from 01:25 to minutes.

Regards, Mark
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now