Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

"MALFORMED GUID"

Posted on 2000-02-14
11
Medium Priority
?
460 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

824 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