Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calculating the number of minutes in a DataColumn.Expression

Posted on 2008-10-03
2
Medium Priority
?
429 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 800 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

660 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