Re: Time convert



On May 8, 5:32 pm, "googlinggoog...@xxxxxxxxxxx"
<googlinggoog...@xxxxxxxxxxx> wrote:
Hello,

I have a database that I have been querying from my visual basic
program to take my access DB and convert it to excel.

I use a multitude of SQL queries to get it to the format I desire, but
i have a time column that has both the date and time within them. When
I open the excel sheet, I only get the date displayed but the time is
there I just have to reformat the column.

Is there a way to query my Access database in such a way I only have
the time and therefore wont see the date?

Basically without knowing exactly what Im typing i have something as
follows (which obviously doesnt work, hence my post ! heh)

SELECT time(convert(), something here, and here) AS DurrationRunning,
Value0 as LightOn
FROM Table1;

So as you can see my plan is to be able to "export" the relevant field
but change the fields name and also change the format to time, and
then export the rest of the fields and change there name on the fly
with "AS"

Thanks In advance

David

Yes, it will have date and time in the field (since it is a date/time
field. However, in Excel you need to format the column to only show
the time (having a date within the field then becomes irrelevant); -
unless in the spreadsheet you are planning on adding up the time
values. And, if that is the case, then in your VB program you wantwill
want to NOT use SQL to do the conversion. What you would want to do is
take the SQL date/time and convert it to a string of date and time,
strip the date from the string and convert the time value back to a
date/time value before putting it into the Excel cell.

.



Relevant Pages

  • RE: Importing data from excel spreadsheets
    ... it spits back a formatted sheet ... The format of the ... their own copy of the database, and get a piece of the formatted spreadsheet, ... Access and Excel are two different animals. ...
    (microsoft.public.access.externaldata)
  • Imported value from Access database changes when displayed in Excel
    ... another database. ... (I know, this is the Excel NG, but this question will ... to just dump the Recordset into the worksheet. ... So is this an Excel XP date format problem. ...
    (microsoft.public.excel.programming)
  • Questions on data exporting
    ... The database is a FF 1.57 relational database, ... export all data to a specific format (e.g. Excel, ... A Cust. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: DAO or ADO
    ... Load a ListBox from a Named Range in Excel using DAO ... is mdb the best database format to use in this case? ... what method should I use for calling up the database from ...
    (microsoft.public.word.vba.general)
  • Re: Is Excel the best MS Office tool to use for this business appl
    ... I did download several of the MS Office Excel ... database for these items. ... the other end of this topic is the fact that my friend has no ... Compile and maintain my friends list of products and their cost, ...
    (microsoft.public.office.misc)