MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 12th, 2002, 09:55 PM   #1
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

I am retrieving a field which is stored in a backend Oracle database as a 5 figure 'general' time field .I've tried reformatting in the query, and also reformatting the field after retrieval, but I can't get Excel to understand it.
The application database displays the field as 'hh:mm'.
Ultimately, I want to concatenate this field with a corresponding date field, to use the exact time/date, to query for only the stuff I haven't already processed. The date field was 'date/time' and excel had no problems with it .
Unlike Excel, the serial number in the Oracle time field is a whole number.
Has anyone else come across this problem ?
sutjh is offline   Reply With Quote
Old Mar 12th, 2002, 10:14 PM   #2
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

Hi

Can you give a relavent example of how a particular time look in Excel AFTER it's been imported. It would also help if you supplied the time is should be.


Dave Hawley is offline   Reply With Quote
Old Mar 12th, 2002, 10:43 PM   #3
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

format([BOOK_TIME],"hh:mm")

gives 00:00 for EVERY serial number

"hh:mm:ss"
= 00:00:00: - ditto

more interestingly,
format([BOOK_TIME],"c")

gives dates like 12/05/2145, 01/07/2034 !!?

reformatting the cells in Excel produces the exactly the same results (I guess it would, really..)

I've tried all the functions, including add-ins Analysis Tool-Pak, but none were really suitable.

I will make dummy entries later on today when back at work, for midnight, midday, 3 o'clock, and 6 o'clock and a few half hour entries , query the database for these entries and post the corresponding serial numbers..

I won't give up, as I am sure Oracle don't use random numbers !!

Thanks for being there.......


sutjh is offline   Reply With Quote
Old Mar 12th, 2002, 11:08 PM   #4
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

I must say this is the first time I've heard of this problem, but then I dont wander too far from Excel/VBA either.

If you are constantly getting 00:00 this would strongly indicate that the time is a number greater than, or equal to 1
Excel stores times as decimal fractions, it sees times as a portion of a day, with 1 being a whole day. It sees dates as serial numbers with 1 being the date 1/1/1900, 2 being 1/2/1900 etc. If you enter a Date and a Time is the same cell you get decimal value added to the date, this represents the time of the day for that date. For eaxmple the date and time of "1/1/1900 18:00" has an underlying value of 1.75

The fact you ended up with "01/07/2034" for a time suggest that oracle is storing this time as "49126". I say this because the date 01/07/2034 is 49125 days ahead of 1/1/1900 (1)


In a nutshell, once we find out the method Oracle uses it should only be matter of finding out the expression needed to convert it.


_________________
Kind Regards
Dave Hawley
OzGrid Business Applications
Microsoft Excel/VBA Training


[ This Message was edited by: Dave Hawley on 2002-03-12 22:15 ]
Dave Hawley is offline   Reply With Quote
Old Mar 12th, 2002, 11:38 PM   #5
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

I think you are exactly right !

Searching has brought little to light on Oracle's methods, and I think I my only hope is to work out the serial number's relationship with a time value.

I was hoping someone had done this before (surely I am not the only person in the world who has to analyse in Excel from Oracle ?)!

I can't say I have had much experience in resolving expressions, I guess I'll just get a few numbers from both sides of the equation
and go from there ?




sutjh is offline   Reply With Quote
Old Mar 12th, 2002, 11:41 PM   #6
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

sutjh, have you tried a search on google.com, I am sure (as you say) this has been done before.


Dave Hawley is offline   Reply With Quote
Old Mar 13th, 2002, 12:09 AM   #7
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

Dave, yeh, just a few !

Maybe my wording wasn't the best, though...

The datatype is 'general', and using words like 'convert', 'Oracle', 'Excel', 'Time',
'Date' just gets very 'general' hits ! After ploughing through 5 pages of 100,000 sites and finding nothing remotely relevant, I felt it was time to try the experts !



sutjh is offline   Reply With Quote
Old Mar 13th, 2002, 12:20 AM   #8
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

There is a very good guy on this site called "Ivan" try posting a question with his name in the Subject, he may well know the answer to this.


Dave Hawley is offline   Reply With Quote
Old Mar 13th, 2002, 05:47 PM   #9
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

sutjh is offline   Reply With Quote
Old Mar 13th, 2002, 05:57 PM   #10
Guest
 
Posts: n/a
Default

Solved - turns out that any Oracle serial number divided by an Excel serial number always equals 86400 -the number of seconds in a day.

Now I can query for data with this concatenated field

Format([BOOK_DATE]++([BOOK_TIME]/86400),"c")

which gives me a figure which Excel can format.

Thanks for all help !
  Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:17 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes