A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date format



 
 
Thread Tools Display Modes
  #1  
Old March 12th, 2005, 07:29 AM
Mike
external usenet poster
 
Posts: n/a
Default Date format

In MS Excel I convert a cell that contains the following into minutes:
1d 01h 12m would convert to 24.2...

The code is:

=IF(iserror(FIND("d",E2)),0,LEFT(E2,FIND("d",E2)-1)*24)+MID(E2,FIND("h",E2)-2,2)+MID(E2,FIND("m",E2)-2,2)/60

Is there a way for Access to convert d h m into hh.m?

Thanks,
Mike
  #2  
Old March 12th, 2005, 08:45 AM
John Nurick
external usenet poster
 
Posts: n/a
Default

Hi Mike,

You can write the corresponding expression in VBA, using Instr() instead
of FIND().

On Fri, 11 Mar 2005 22:29:01 -0800, "Mike"
wrote:

In MS Excel I convert a cell that contains the following into minutes:
1d 01h 12m would convert to 24.2...

The code is:

=IF(iserror(FIND("d",E2)),0,LEFT(E2,FIND("d",E2 )-1)*24)+MID(E2,FIND("h",E2)-2,2)+MID(E2,FIND("m",E2)-2,2)/60

Is there a way for Access to convert d h m into hh.m?

Thanks,
Mike


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
  #3  
Old March 12th, 2005, 12:42 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

Check my October, 2003 Access Answers column in Pinnacle Publication's Smart
Access.

You can get the column (and accompanying database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Mike" wrote in message
...
In MS Excel I convert a cell that contains the following into minutes:
1d 01h 12m would convert to 24.2...

The code is:

=IF(iserror(FIND("d",E2)),0,LEFT(E2,FIND("d",E2)-1)*24)+MID(E2,FIND("h",E2)-2,2)+MID(E2,FIND("m",E2)-2,2)/60

Is there a way for Access to convert d h m into hh.m?

Thanks,
Mike



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing and storing a different date format Jim T General Discussion 1 November 2nd, 2004 02:45 PM
i cant change the format of the date when referencing another cell Brian Worksheet Functions 3 September 29th, 2004 05:02 AM
Date format incorrect mail merge Emily Mailmerge 1 September 9th, 2004 10:22 AM
Date Format Date Formating Problem Database Design 3 August 16th, 2004 06:41 PM
If statement Doug Worksheet Functions 9 June 28th, 2004 06:13 AM


All times are GMT +1. The time now is 02:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.