Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ms Query Parameters Referencing to a Cell

Status
Not open for further replies.

Salut39

Technical User
Aug 2, 2006
178
GB
Hi

Following the thread68-1637794 I was trying to Enter Formula =TEXT(A1,"YYYY-MM-DD") in parameter's window.

But for some reason as soon as I enter formula update does not work. If I enter the same formula in cell and reference to that cell it works fine.

I want to know why it's not working in parameters window. Any ideas?

Yuri
 

Never tried to enter data of any kind in the Parameter Window, when a cell works just as well, or in this case, BETTER! Why complicate things?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I am not trying to complicate I try to simplify. I have a cell(A1) where I enter date as parameter but database doesn't recognise the format. I create another cell(B1) to convert the date to text. Instead I wanted to refer to date cell(A1) but convertion formula to be entered ones in parameter's window. But it's surprisingly not working.
 

Reference the cell containing the TEXT formula in the parameters window.

Change your QUERY, if you have not already, to expect TEXT rather than date, like...
Code:
WHERE to_char(LPST,'yyyy-mm-dd')=?


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Because it come from my SQL it's expecting date in format 2012-05-21, but Excel converts it to date, parameters only work if I format date to =TEXT(A1,"YYYY-MM-DD") . I would rather query expected field to be as DATE but don't know how to do it.
 
The PROBLEM is that TEXT is not DATE.

I do not believe that you can embed your parameter in a To Date function in MS Query.

That is why I went the other direction of changing the table date to TEXT.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top