Solved

"MALFORMED GUID"

Posted on 2000-02-14
11
429 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
Comment Utility
Okay, can you post the query?
0
 

Author Comment

by:jtallsup
Comment Utility
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
Comment Utility
I changed the field name in all the appropriate places just to be sure.
No help.
0
 
LVL 2

Expert Comment

by:p_biggelaar
Comment Utility
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
Comment Utility
The name DOS is indeed NOT the problem, see my suggested answer.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:jtallsup
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Excellent, thanks a bunch. The # format did the trick. So much for "SQL Builder"
0
 
LVL 2

Expert Comment

by:p_biggelaar
Comment Utility
you're welcome...
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now