473,378 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

my query it's right ?

132 100+
hi,

i have this scénario :
If request bookings with the following parameters: from = 2009-06-19T08:00:00, to = 2009-06-19T09:00:00
 The distribution system application must return booking B1 with a status = Create
If request bookings with the following parameters: from = 2009-06-19T09 :30 :00, to = 2009-06-19T09 :40 :00
 The distribution system application must return no booking
If request bookings with the following parameters: from = 2009-06-19T09 :50 :00, to = 2009-06-19T10 :10 :00
If request bookings with the following parameters: from = 2009-06-19T10 :20 :00, to = 2009-06-19T11 :00 :00
 The distribution system application must return booking B2 with a status = Cancel

and i want to translation in code Mysql i do that
Expand|Select|Wrap|Line Numbers
  1. select REPLACE(arrival, ' ', 'T') as arrival, REPLACE(departure, ' ', 'T') as departure , case
  2.                         when departure = '2009-06-19 09:00:00' and arrival= '2009-06-19 08:00:00' then 'create'
  3.                         when departure > '2009-06-19 09:00:00' and arrival> '2009-06-19 08:00:00' then 'no booking'
  4.                             when departure > '2009-06-19 09:00:00' and arrival> '2009-06-19 08:00:00' then 'cancel' end as action
  5.  
  6.                         from jo_jomres_contracts
:
it's true or false because i want the time inclusion .

Thanks in advance
Jul 17 '13 #1
0 1073

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Raghu | last post by:
Hello... I am running into a problem while running a query..can some1 help.. this is the query : ************** SELECT * from Table S where S.dtDate1 BETWEEN...
3
by: Matthew | last post by:
I am trying to build a form that has certain criteria on it (combo boxes) which a user can pick from a range of values to specify the criteria he wants when he runs a query on the form. I am...
19
by: bdt513 | last post by:
I am trying to extract the values from a query using VBA. Specifically, I want to concatenate all the values of the "rosEmail" field from query "qselRosterEmailList" into one string (strEmails). I...
4
by: ken | last post by:
Hi, I use this command to run a make table query without opening it... CurrentDb.Execute "make table query name" Access tells me that it can't execute a select query...? Its a make table query...
1
by: vinoda2005 | last post by:
hi friends, I am facing one problem... I am using ms-access . I have parent table with fields (empid(primary key),password,flag).and child table with fields...
3
by: vinoda2005 | last post by:
hi friends, I am facing one problem... I am using ms-access . I have parent table with fields (empid(primary key),password,flag).and child table with fields...
4
by: cihpet | last post by:
Hallo, I am beginner, I want to show on page results of this query: $query="SELECT mr_prehlad.mr_id, mr_kontakt.nazov_mr FROM mr_prehlad RIGHT JOIN mr_kontakt ON mr_kontakt.id_mr=mr_prehlad.mr_id...
2
by: jalmar | last post by:
Hello....I'm back again with the same question. I still haven't been able to figure out why my query isn't working. I am linking a table to an Excel spreadsheet, that part is fine, it is even...
4
by: mak1084 | last post by:
$qselect = 'SELECT ticketID,ticket.created,subject,dept_name,name,email,source,ticket.ticket_id,ticket.dept_id,ticket.staff_id '. ',status,isoverdue,pri.* '; $qfrom=' FROM...
3
by: samour | last post by:
hello every body how can i get red of this error : "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near" ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.