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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem SQL query date changes format

Status
Not open for further replies.

np3il

Programmer
Aug 15, 2002
63
US
The date is formated MM/DD/YYYY and the Designer in VB Reports changes to { d '2002-02-15' }.

I also tryed to PD = '2/15/2002' and I stil get errors.

What am I doing Wrong here ???

SELECT TICKET_NO AS TN, PU_DATE AS PD
FROM TICKETS
WHERE (TICKET_NO > '01999999') AND (TICKET_NO < '03000000')
AND (PU_DATE = { d '2002-02-15' })
ORDER BY TICKET_NO
 
There are two very different things: date values and string values. A string value can be a representation of a date value (made with the format function), but is by no means a date.

If you want to give a date value in a query (assuming the access SQL), you put an american-style date between number signs, for example:

Code:
SELECT TICKET_NO AS TN, PU_DATE AS PD
FROM TICKETS
WHERE (TICKET_NO>'01999999') AND (TICKET_NO<'03000000') 
    AND (PU_DATE=#02-15-2002#)
ORDER BY TICKET_NO;

The result of the query on the report is shown with textboxes. You can set the format of the textbox (the string representation) to whatever you like.

Best regards
 
Is there a way to change this date at run-time from VB6 using the Data Report Designer within VB6???

B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top