Solved

"MALFORMED GUID"

Posted on 2000-02-14
11
438 Views
Last Modified: 2008-02-01
vb6, access97. I have a datareport which works fine until I try to put a search criteria into a date field. {Criteria for other fields OK). The SQL statement generated by the SQL designer looks fine to me. (But I am a beginner.) When saving the ammended query, I get this message: "To retrieve information for this Command, the Command must be executed. You may need to specify input parameter values in the Paramter tabe before the command is executed. Execution may add to or modify data in the database." Have no idea what to do with the Parameter Tab. Ther are no options presented, and all is greyed out. When I save it anyway, the msg is "MALFORMED GUID in query expression....."   When running the program, of course, the report won't run, "Errors encountered".  When I remove the criteria, everything is fine once again. As I said, I am a newbie, so it may take a fairly detailed answer to do me any good. If anyone can get me out of this jam, I would truly appreciate it.
0
Comment
Question by:jtallsup
  • 7
  • 4
11 Comments
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2521970
Okay, can you post the query?
0
 

Author Comment

by:jtallsup
ID: 2522847
Sure, here it is: "SELECT ID, Patient, Provider, FinalBill, MyPmnts, Unpaid, DOS From Bills WHERE [DOS BETWEEN {d'1999-01-01'} AND {d'1999-12-31'}]

Any chance that my field name "DOS" has a problem being a reserved or protected term? If so, it only happens when a criteria is assigned, otherwise OK.
0
 

Author Comment

by:jtallsup
ID: 2522955
I changed the field name in all the appropriate places just to be sure.
No help.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2522959
Don't use the square brackets!! ([]) They are used to tell the SQL engine you are referring to a field.

This would be okay:
SELECT ID, Patient, Provider, FinalBill, MyPmnts, Unpaid, DOS From Bills WHERE (DOS BETWEEN {d'1999-01-01'} AND {d'1999-12-31'})

or:
SELECT ID, Patient, Provider, FinalBill, MyPmnts, Unpaid, DOS From Bills WHERE (DOS BETWEEN {d'1999-01-01'} AND {d'1999-12-31'})
0
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2522984
The name DOS is indeed NOT the problem, see my suggested answer.
0
 

Author Comment

by:jtallsup
ID: 2523379
No help, exact same error. Please check your previous, you seem to have offered me two identical options.
Futher info: WHERE DOS BETWEEN (1999-01-01) AND (1999-12-31) does not generate any errors, but also returns no records in the report. WHERE DOS BETWEEN (d'1999-01-01) AND (d'1999-12-31) results in a different error msg:
"Syntax error (missing operator) in
'DOS BETWEEN .........'
0
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2523529
There was nothing wrong with the brackets you used around the dates. Try this one:

SELECT ID, Patient, Provider, FinalBill, MyPmnts, Unpaid, DOS From Bills WHERE DOS between #8/10/1999# And #9/10/1999#
0
 
LVL 2

Accepted Solution

by:
p_biggelaar earned 100 total points
ID: 2523532
Or of course using your dates:

SELECT ID, Patient, Provider, FinalBill, MyPmnts, Unpaid, DOS From Bills WHERE DOS between #1/1/1999# And #12/31/1999#
0
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2523546
One more comment: the syntax you were using (the {d'DATE')} etc... bit) works in T-SQL, or SQL-server, but indeed not in Access97.
0
 

Author Comment

by:jtallsup
ID: 2523644
Excellent, thanks a bunch. The # format did the trick. So much for "SQL Builder"
0
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2523699
you're welcome...
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question