Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This forum is the most helpful site I've ever used. I used to use Deja.com; but, this site is better - hands down!..."

Geography

Where in the world do Tek-Tips members come from?

Ms Query Parameters Referencing to a Cell

Salut39 (TechnicalUser)
21 May 12 7:17
Hi

Following the thread68-1637794: Excel/MS Query: Change format of date and dollar amount 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
SkipVought (Programmer)
21 May 12 8:53

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,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Salut39 (TechnicalUser)
21 May 12 9:39
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.
SkipVought (Programmer)
21 May 12 9:55

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,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Salut39 (TechnicalUser)
21 May 12 10:23
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.
SkipVought (Programmer)
21 May 12 10:30
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,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close