Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pablito
Starting Member
2 Posts |
Posted - 2008-05-02 : 17:16:45
|
hi,I have this query, with this I get 60 individuals reports...SELECT cedula, UPPER(nombres) AS Nombre, UPPER(sala) AS Sala, turno, fechaactividadFROM clinicasWHERE (fechaactividad = @fechaactividad) AND (turno = @turno) AND (sala = @sala)GROUP BY cedula, nombres, sala, turno, fechaactividadORDER BY NEWID() I want to write a query but using a group by sentence and using this parameters:fechaactividad: Datetime.Now (but are five days per week, date initial, date final)turno: AM/PMsala = this are 6 roomsthe first report:fechaactividad = actual date, turno = AM sala = one.the second report:fechaactividad = actual date, turno = PM sala = one.the third report:fechaactividad = actual date, turno = AM sala = two.fechaactividad = actual date, turno = PM sala = one.this function NEWID() is used to randomize the users.and so...anyone can give me some tips or a example query that I can adapted to my request?I dont have idea in how do I its.I want to build a one click report, this is for a very old woman with very bad computer experience... :(Thanks,Pablito |
|
pablito
Starting Member
2 Posts |
Posted - 2008-05-02 : 17:32:21
|
sorry other things.I want to set the date, and the @turno and @sala are constantsturno is = AM/PMsala is = uno, dos, tres, cuatro, cinco, seis.the first report is April,21 2008 AM, sala unothe second report is April,21 2008 PM, sala unothe third report is April,21 2008 AM, sala dosthe 4 report is April,21 2008 PM, sala doslatersecond datethe first report is April,22 2008 AM, sala unothe second report is April,22 2008 PM, sala unothe third report is April,22 2008 AM, sala dosthe 4 report is April,22 2008 PM, sala dosthis is I mean. |
 |
|
|
|
|
|
|