0

Hello everyone

I've been trying to google this and had no luck with this issue

So i have this form where it prints a certain record i search, but im trying to do restaurant form and a print form that it will print the last order done.

So I Know how to print it via search in a crystal report form, but i'm changing the view and i want it to print the last order saved.

So basically what i need is an SQL Query that will move to the last record created.

Hope i made myself clear what i need

Thanks in advance

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by ChrisPadgham
0

Use order by desc clause.

SELECT * FROM TABLENAME ORDER BY OrderTakenDateTime DESC

Ok so let me try that and see what it does

Thanks

0

If you only want the last record, you may like to add TOP(1) to that however if you are working in a multi-user environment then you may not get the record you wrote.

It may be better to have a "OrderPrinted" column to record whether an order has been printed or not.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.