Solved

Calculating the number of minutes in a DataColumn.Expression

Posted on 2008-10-03
2
424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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