Re: Need help with query linked to form.
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Thu, 10 Jul 2008 23:29:06 +0800
How are you, 'pulling the table'?
Is it linked or imported?
If imported, do you use a Make Table query? An Append query? Or TransferDatabase? Or ...?
The data type is the problem: Access is not making sense of applying the date/time parameter to the Text field.
If you can't import it propertly, it may be possible to use a query to generate a date/time field, using CVDate(), or Left(), Mid(), and Right() to parse the values and DateSerial() to make a true date. Getting the data type right in the table would be preferable though.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Dan" <Dan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:58FBE3BA-A3FA-416A-97AE-AAFE7EA49F22@xxxxxxxxxxxxxxxx
OK, I think this is the problem when I loked at the table it was in fact set
to Text. So now a new question. I am pulling this data via ODBC and for the
dates that are brought in they default to text. Is there an easy or quick way
to make this feild change or default to Date format when I pull in the table?
"Allen Browne" wrote:
That should be okay.
If you open the table named PO data-t in design view, what is the Data Type
of the HDODAT column? I am assuming it is Date/Time (not Text or Number.)
Try:
PARAMETERS [Forms]![Open Po - f]![Query date] DateTime;
SELECT [PO data-t].*
FROM [PO data-t]
WHERE HDODAT = [Forms]![Open Po - f]![Query date];
"Dan" <Dan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2D7E3F1B-AB4E-4A90-B1AA-DD8D10AD3C6E@xxxxxxxxxxxxxxxx
> Here is the SQL.
>
PARAMETERS [Forms]![Open Po - f]![Query date] DateTime;
SELECT [PO data-t].[HDSTH#],
[PO data-t].[HDPO#],
[PO data-t].HDVID,
[PO data-t].VXDNAM,
[PO data-t].HDODAT,
[PO data-t].HDDDAT,
[PO data-t].HDBUYR,
[PO data-t].[LNLN#],
[PO data-t].LNITEM,
[PO data-t].LNDESC,
[PO data-t].LNVCAT,
[PO data-t].[LNGL#],
[PO data-t].LNLCID,
[PO data-t].LNOQTY,
[PO data-t].LNRQTY,
[PO data-t].LNUNIT,
[PO data-t].LNUPRC,
[PO data-t].LNXLNT,
[PO data-t].LNDDAT,
[PO data-t].LNTYPE,
[PO data-t].HDRSTS,
[PO data-t].LNRSTS
FROM [PO data-t]
WHERE ((([PO data-t].HDODAT)=[Forms]![Open Po - f]![Query date]));
>
>> Yes: post the SQL please.
>>
>> > Allen thank you for that info. I think it is what I needed but I am >> > now
>> > now getting an error stating that "This expression is typed
>> > incorrectly,
>> > or it is too complex to be evaluated.
.
- Follow-Ups:
- Re: Need help with query linked to form.
- From: Dan
- Re: Need help with query linked to form.
- References:
- Re: Need help with query linked to form.
- From: Allen Browne
- Re: Need help with query linked to form.
- From: Allen Browne
- Re: Need help with query linked to form.
- From: Dan
- Re: Need help with query linked to form.
- From: Allen Browne
- Re: Need help with query linked to form.
- From: Dan
- Re: Need help with query linked to form.
- Prev by Date: Re: Crosstab
- Next by Date: Re: Access SQL Question
- Previous by thread: Re: Need help with query linked to form.
- Next by thread: Re: Need help with query linked to form.
- Index(es):
Relevant Pages
|