PC Review


Reply
Thread Tools Rate Thread

Date Values and Pass Through Queries

 
 
=?Utf-8?B?RXhjZWxFZA==?=
Guest
Posts: n/a
 
      29th Mar 2007
Hi
I am trying to get a Date Value in the format YYYY-MM from a MySQL database
using a pass through query. When I run the query I get this result - 〲㘰ã€*.
If I run this query in MySQL i get the correct result - Why does Access not
understand it?
Any help would be greatly appreciated
 
Reply With Quote
 
 
 
 
Pat Hartman \(MVP\)
Guest
Posts: n/a
 
      29th Mar 2007
Since users shouldn't be looking at queries in any event, it would be better
to set the format property of the form or report control to format the date
field.

"ExcelEd" <(E-Mail Removed)> wrote in message
news:6A13F758-7787-4A35-B730-(E-Mail Removed)...
> Hi
> I am trying to get a Date Value in the format YYYY-MM from a MySQL
> database
> using a pass through query. When I run the query I get this result - ???.
> If I run this query in MySQL i get the correct result - Why does Access
> not
> understand it?
> Any help would be greatly appreciated



 
Reply With Quote
 
=?Utf-8?B?RXhjZWxFZA==?=
Guest
Posts: n/a
 
      29th Mar 2007
Hi Pat
Thanks for your input, however I only really use Access for the Pass through
query functionality (Its the quickest way to get data from a MySQL database
into Excel). I therefore dont have any forms or reports, i just use the
query interface

"Pat Hartman (MVP)" wrote:

> Since users shouldn't be looking at queries in any event, it would be better
> to set the format property of the form or report control to format the date
> field.
>
> "ExcelEd" <(E-Mail Removed)> wrote in message
> news:6A13F758-7787-4A35-B730-(E-Mail Removed)...
> > Hi
> > I am trying to get a Date Value in the format YYYY-MM from a MySQL
> > database
> > using a pass through query. When I run the query I get this result - ???.
> > If I run this query in MySQL i get the correct result - Why does Access
> > not
> > understand it?
> > Any help would be greatly appreciated

>
>
>

 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      29th Mar 2007
ExcelEd wrote:
>>> Hi
>>> I am trying to get a Date Value in the format YYYY-MM from a MySQL
>>> database
>>> using a pass through query. When I run the query I get this result
>>> - ???. If I run this query in MySQL i get the correct result - Why
>>> does Access not
>>> understand it?
>>> Any help would be greatly appreciated


By definition, a passthrough query uses the "flavor" of SQL that is
supporeted by the server you are connecting to (in your case MySQL). There
should be nothing for "Access" to understand, only MySQL needs to understand
it.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com




 
Reply With Quote
 
=?Utf-8?B?RXhjZWxFZA==?=
Guest
Posts: n/a
 
      29th Mar 2007
When the same query is run in non Access Applications, such as MySQL Query
Browser, it works fine - so the query works ok.

"Rick Brandt" wrote:

> ExcelEd wrote:
> >>> Hi
> >>> I am trying to get a Date Value in the format YYYY-MM from a MySQL
> >>> database
> >>> using a pass through query. When I run the query I get this result
> >>> - ???. If I run this query in MySQL i get the correct result - Why
> >>> does Access not
> >>> understand it?
> >>> Any help would be greatly appreciated

>
> By definition, a passthrough query uses the "flavor" of SQL that is
> supporeted by the server you are connecting to (in your case MySQL). There
> should be nothing for "Access" to understand, only MySQL needs to understand
> it.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
>
>
>
>

 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      29th Mar 2007
ExcelEd wrote:
> When the same query is run in non Access Applications, such as MySQL
> Query Browser, it works fine - so the query works ok.


And your quite sure it is a passthrough query and not a local query against
a linked table? If so, that would make me wonder about the driver you are
using more than anything else.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
=?Utf-8?B?RXhjZWxFZA==?=
Guest
Posts: n/a
 
      29th Mar 2007
Yep 100% Sure its a pass through query

To access the data I am using ODBC MySQL 3.5.1 Driver if that helps



"Rick Brandt" wrote:

> ExcelEd wrote:
> > When the same query is run in non Access Applications, such as MySQL
> > Query Browser, it works fine - so the query works ok.

>
> And your quite sure it is a passthrough query and not a local query against
> a linked table? If so, that would make me wonder about the driver you are
> using more than anything else.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
>
>

 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      29th Mar 2007
ExcelEd wrote:
> Yep 100% Sure its a pass through query
>
> To access the data I am using ODBC MySQL 3.5.1 Driver if that helps


And you are getting ???? in the datasheet of the passsthrough query wher you
shoudl get the date? What syntax does MySQL use to return a date in a
specified format?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
=?Utf-8?B?RXhjZWxFZA==?=
Guest
Posts: n/a
 
      29th Mar 2007
To get a date vale in YYYY-MM format where the date value is called
"request_dat" you use the following funtion

date_format(request_date_sold,'%Y-%m')

Access returns ????

"Rick Brandt" wrote:

> ExcelEd wrote:
> > Yep 100% Sure its a pass through query
> >
> > To access the data I am using ODBC MySQL 3.5.1 Driver if that helps

>
> And you are getting ???? in the datasheet of the passsthrough query wher you
> shoudl get the date? What syntax does MySQL use to return a date in a
> specified format?
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
>
>

 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      29th Mar 2007
ExcelEd wrote:
> To get a date vale in YYYY-MM format where the date value is called
> "request_dat" you use the following funtion
>
> date_format(request_date_sold,'%Y-%m')
>
> Access returns ????


Mystery to me. Any time I have used a passthrough query that returned a
type Access didn't understand it just treated it as text.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass Date Values to display report =?Utf-8?B?SGVhdGhlckQyNQ==?= Microsoft Access Reports 2 3rd Nov 2005 07:10 PM
Pass-Through Queries Bre-x Microsoft Access Getting Started 2 9th Nov 2004 08:36 PM
Re: Pass-Through Queries Alex Dybenko Microsoft Access VBA Modules 2 13th Aug 2004 06:02 AM
Queries using parameter queries, assigning values to for params in called query, is it possible? =?Utf-8?B?RnJhbmsgTS4=?= Microsoft Access Queries 1 13th Mar 2004 07:06 AM
Pass-thru queries George Microsoft Access Queries 0 22nd Aug 2003 07:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 AM.