Solved

Calculating the number of minutes in a DataColumn.Expression

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

12 Experts available now in Live!

Get 1:1 Help Now