Solved

Calculating the number of minutes in a DataColumn.Expression

Posted on 2008-10-03
2
420 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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