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 TouchToneTommy 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
1)In the SQL Builder from VB6, I need to segregate the data with the user entered date.

Ex. Report for the Date: 02/15/2002

the SQL Builder is changing it to ={d '2002-2-15'} format.

Is there a way to prevent vb6 to change the format??

2) I also need to compare a portion of the Item to the user entered one.

Ex. Enter Store for Report: 2

Using the sane SQL statement,
TTCKET_NO = "02001234" ... etc ...

The Store is the first two characters of the ticket. "02.."

...
SELECT TICKETS.TICKET_NO, TICKETS.PU_TIME,
CUSTOMER.FIRSTNAME, CUSTOMER.LASTNAME,
TICKETS.LAST_TICK, TICKETS.PU_EMPL,
SERVICES.SERV_ABBR, TICKETS.PU_DATE,
TICKETS.STRIP_TAG, DETAIL.PRICE, DETAIL.QUANITY,
PRICES.ITEM_NAME, COLORS.COLOR_DESC,
COLORS.PATT_DESC
FROM TICKETS, DETAIL, SERVICES, PRICES, COLORS,
CUSTOMER
WHERE TICKETS.TICKET_NO = DETAIL.TICKET_NO AND
TICKETS.SERV_CODE = SERVICES.SERV_CODE AND
DETAIL.ITEM_CODE = PRICES.ITEM_CODE AND
DETAIL.COLOR_NO = COLORS.COLOR_NO AND
TICKETS.CUST_NO = CUSTOMER.CUST_NO AND
(TICKETS.PU_DATE = { d '2002-02-15' })
ORDER BY TICKETS.TICKET_NO, TICKETS.PU_TIME
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top