hi pls tell me this command is correct or not.....
if wrong give me the correct command.......

"insert into guesthouse(status) values ('C' where (date_of_arr <= getdate() and date_of_dept<=getdate()) or 'O' where(date_of_arr <= getdate() and date_of_dept >= getdate() or 'S' where (date_of_arr >= getdate() and date_of_dept >= getdate())

here iam insert into status as follows

status when

=C (date_of_arr <= getdate() and date_of_dept<=getdate())
=O (date_of_arr <= getdate() and date_of_dept >= getdate()
=S (date_of_arr >= getdate() and date_of_dept >= getdate()

here date_of_arr and date_ of_dept are entering date and departure date...........and get date is system date

Try it and see for yourself, if it doesn't work tell us the error.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.