Re: Time convert
- From: KwikOne <kerrykurtz@xxxxxxxxx>
- Date: 23 May 2007 10:15:57 -0700
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.
.
- References:
- Time convert
- From: googlinggoogler@xxxxxxxxxxx
- Time convert
- Prev by Date: Time convert
- Next by Date: seek method on 2 table and filed
- Previous by thread: Time convert
- Next by thread: seek method on 2 table and filed
- Index(es):
Relevant Pages
|