Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-2008, 09:42 PM
=?Utf-8?B?RGFu?=
 
Posts: n/a
Date/Time Text.

uHi all, I am pulling some data through ODBC and one of the feilds I pull is
a datetimestamp which comes across as text and looks like this 2006-07-03
08:45:14.571000 What I am trying to do is pull this exact info in a make
table query but have it be a Date/Time format instead of text. I have tried
CDATE which works for pulling out just the date as a date field, but I am not
able to get it to include the times also. Any help on this would be great.
Thanks
Reply With Quote
  #2 (permalink)  
Old 08-11-2008, 09:48 PM
=?Utf-8?B?Unlhbg==?=
 
Posts: n/a
RE: Date/Time Text.

Try this in your make table query.
FormatedDate:Format$([YourDateField],'mm/dd/yyyy hh:mm:ss')
Then right click on the column in your query and set its format to "short
date"
--
Please remember to mark this post as answered if this solves your problem.


"Dan" wrote:

> uHi all, I am pulling some data through ODBC and one of the feilds I pull is
> a datetimestamp which comes across as text and looks like this 2006-07-03
> 08:45:14.571000 What I am trying to do is pull this exact info in a make
> table query but have it be a Date/Time format instead of text. I have tried
> CDATE which works for pulling out just the date as a date field, but I am not
> able to get it to include the times also. Any help on this would be great.
> Thanks

Reply With Quote
  #3 (permalink)  
Old 08-11-2008, 09:58 PM
=?Utf-8?B?RGFu?=
 
Posts: n/a
RE: Date/Time Text.

When, I use the "Format" it leaves the Data Type as Text instead of changing
it to DATE/TIME in the table. I need the data in the table to be DATE/TIME.
This is why I have used CDATE in the past because it changes the Data Type to
Date/Time.

"Ryan" wrote:

> Try this in your make table query.
> FormatedDate:Format$([YourDateField],'mm/dd/yyyy hh:mm:ss')
> Then right click on the column in your query and set its format to "short
> date"
> --
> Please remember to mark this post as answered if this solves your problem.
>
>
> "Dan" wrote:
>
> > uHi all, I am pulling some data through ODBC and one of the feilds I pull is
> > a datetimestamp which comes across as text and looks like this 2006-07-03
> > 08:45:14.571000 What I am trying to do is pull this exact info in a make
> > table query but have it be a Date/Time format instead of text. I have tried
> > CDATE which works for pulling out just the date as a date field, but I am not
> > able to get it to include the times also. Any help on this would be great.
> > Thanks

Reply With Quote
  #4 (permalink)  
Old 08-11-2008, 10:26 PM
=?Utf-8?B?Unlhbg==?=
 
Posts: n/a
RE: Date/Time Text.

MyDate = "October 19, 1962" ' Define date.
MyShortDate = CDate(MyDate) ' Convert to Date data type.
MyTime = "4:35:47 PM" ' Define time.
MyShortTime = CDate(MyTime) ' Convert to Date data type.
--
Please remember to mark this post as answered if this solves your problem.


"Dan" wrote:

> When, I use the "Format" it leaves the Data Type as Text instead of changing
> it to DATE/TIME in the table. I need the data in the table to be DATE/TIME.
> This is why I have used CDATE in the past because it changes the Data Type to
> Date/Time.
>
> "Ryan" wrote:
>
> > Try this in your make table query.
> > FormatedDate:Format$([YourDateField],'mm/dd/yyyy hh:mm:ss')
> > Then right click on the column in your query and set its format to "short
> > date"
> > --
> > Please remember to mark this post as answered if this solves your problem.
> >
> >
> > "Dan" wrote:
> >
> > > uHi all, I am pulling some data through ODBC and one of the feilds I pull is
> > > a datetimestamp which comes across as text and looks like this 2006-07-03
> > > 08:45:14.571000 What I am trying to do is pull this exact info in a make
> > > table query but have it be a Date/Time format instead of text. I have tried
> > > CDATE which works for pulling out just the date as a date field, but I am not
> > > able to get it to include the times also. Any help on this would be great.
> > > Thanks

Reply With Quote
  #5 (permalink)  
Old 08-11-2008, 10:45 PM
Douglas J. Steele
 
Posts: n/a
Re: Date/Time Text.

Access will only work with hh:mm:ss, not fractional seconds.

Try importing it as text, then adding a date field, populating it using

CDate(Left([TextDateField], InStr([TextDateField], ".") - 1)

Of course, that assumes that every field has the fraction seconds. If that's
not the case, you may need to use

CDate(IIf(InStr([TextDateField], ".") = 0, [TextDateField],
Left([TextDateField], InStr([TextDateField], ".") - 1)

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


"Dan" <Dan@discussions.microsoft.com> wrote in message
news:F7F55FD1-F54D-4D17-A493-538D4F7578E8@microsoft.com...
> uHi all, I am pulling some data through ODBC and one of the feilds I pull
> is
> a datetimestamp which comes across as text and looks like this 2006-07-03
> 08:45:14.571000 What I am trying to do is pull this exact info in a make
> table query but have it be a Date/Time format instead of text. I have
> tried
> CDATE which works for pulling out just the date as a date field, but I am
> not
> able to get it to include the times also. Any help on this would be great.
> Thanks



Reply With Quote
  #6 (permalink)  
Old 08-13-2008, 04:21 PM
=?Utf-8?B?RGFu?=
 
Posts: n/a
Re: Date/Time Text.

Doug, As always it worked like a charm. Thanks for your help.

"Douglas J. Steele" wrote:

> Access will only work with hh:mm:ss, not fractional seconds.
>
> Try importing it as text, then adding a date field, populating it using
>
> CDate(Left([TextDateField], InStr([TextDateField], ".") - 1)
>
> Of course, that assumes that every field has the fraction seconds. If that's
> not the case, you may need to use
>
> CDate(IIf(InStr([TextDateField], ".") = 0, [TextDateField],
> Left([TextDateField], InStr([TextDateField], ".") - 1)
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Dan" <Dan@discussions.microsoft.com> wrote in message
> news:F7F55FD1-F54D-4D17-A493-538D4F7578E8@microsoft.com...
> > uHi all, I am pulling some data through ODBC and one of the feilds I pull
> > is
> > a datetimestamp which comes across as text and looks like this 2006-07-03
> > 08:45:14.571000 What I am trying to do is pull this exact info in a make
> > table query but have it be a Date/Time format instead of text. I have
> > tried
> > CDATE which works for pulling out just the date as a date field, but I am
> > not
> > able to get it to include the times also. Any help on this would be great.
> > Thanks

>
>
>

Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:44 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Loans | Child Trust Funds | Loans | Loans | Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114