Fabio
Why is it you need it? I have an OperationID field which is the primary key for the table, but i don't think it's relevant in this case.
Here, the user will enter the date for Sunday ( let's call it SunDate ) and i just extract all records where BETWEEN( CDate, SunDate, SunDate+3 ) ordered by CTime.
Jaime
>>Fabio
>>Great idea! Still, not quite there. As you can notice in my sample data, sometimes CTime is unique ( because it happened on Sunday for Fabio in this case ) but sometimes we can have it many times ( 2 patients the same day at the same time )
>>
>>Jaime
>>
>>>>Hi SQL gurus
>>>>I have the following fields:
>>>>CDate(D), CTime (C5), Patient (C30)
>>>>As you may have understood, CDate holds dates, ctime times ( military ) and patient holds names.
>>>>I am trying to get to the following, but since i think i may use only one UNION per select, i don't know if it's possible in one select command:
>>>>
>>>>CTime Sunday Monday Tuesday Wednesday
>>>>----- ------- ------ ------- ---------
>>>>10:00 Sergio Ken Alfred
>>>>10:15 Joseph
>>>>10:15 Kim
>>>>10:30 Fabio
>>>>
>>>>Well, you get the drill...
>>>>
>>>>TIA
>>>>Jaime
>>>
>>>Hi
>>>
>>>* hypothesis : COUNT(DISTINCT CTime,DOW(CDate))<=1
>>>SELECT ;
>>> CTime ;
>>>, MAX(IIF(DOW(CDate)=1,Patient,SPACE(30)))AS Sunday ;
>>>, MAX(IIF(DOW(CDate)=2,Patient,SPACE(30)))AS Monday ;
>>>, MAX(IIF(DOW(CDate)=3,Patient,SPACE(30)))AS Tuesday ;
>>>...
>>> FROM theTable;
>>> GROUP BY 1
>>>* hypothesis : COUNT(DISTINCT CTime,DOW(CDate))>1
>>>* ask me
>>>
>
>Give to me the primary key and candidate keys of the table.
Why do programs stop working correctly as soon as you leave the Fox?