MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 19th, 2005, 07:16 AM
juanmanuelsanch juanmanuelsanch is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 25 juanmanuelsanch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 27 sec
Reputation Power: 0
Problem with Dates

hi all ! I have this code. That should show me all th dates from a date.
What I want is that when the quey comes it should be ordered by Tipo
that its a charvar and Date wich is date type. BUt its not doing either of
both.

Can you help me out ?

Code:
 
public ResultSet busquedaCitas2(java.sql.Date fecha_cita)
throws SQLException 
{ //falta un group by 
System.out.println(fecha_cita);
System.out.println("Entro en busquedaCitas2");
String sql = "Select*,paciente.Nombres,paciente.Apellidos,pacien  te.Prescriptor,paciente.Mutua,sesiones.Sesigast,se  siones.Sesifaltantes,protocolo.Tipo FROM citas, paciente,sesiones,protocolo WHERE citas.Fecha=? AND paciente.DNI=citas.DNI AND paciente.DNI=sesiones.DNI AND sesiones.Protocolo=citas.Protocolo AND citas.Protocolo=protocolo.Nombre ORDER BY citas.Hora DESC,protocolo.Tipo";
PreparedStatement pstmt = conexion.prepareStatement(sql);
pstmt.setDate(1,fecha_cita); 
cdr=pstmt.executeQuery();
return cdr;
}
 
Thanks!

Reply With Quote
  #2  
Old March 19th, 2005, 09:02 AM
juanmanuelsanch juanmanuelsanch is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 25 juanmanuelsanch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 31 m 27 sec
Reputation Power: 0
sorry its Citas wich is a Time var. Not Date

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Problem with Dates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway