Click here to Skip to main content
15,914,820 members
Home / Discussions / Database
   

Database

 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian31-Jan-05 8:50
wilsonian31-Jan-05 8:50 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham31-Jan-05 11:14
Rob Graham31-Jan-05 11:14 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian31-Jan-05 11:53
wilsonian31-Jan-05 11:53 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham31-Jan-05 14:44
Rob Graham31-Jan-05 14:44 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian31-Jan-05 16:34
wilsonian31-Jan-05 16:34 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham1-Feb-05 2:42
Rob Graham1-Feb-05 2:42 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian1-Feb-05 8:52
wilsonian1-Feb-05 8:52 
GeneralSet RowCount issue in query containing function tables Pin
-Dr_X-27-Jan-05 4:52
-Dr_X-27-Jan-05 4:52 
I have the query below which contains 2 functions which return tables, fn_SamplesUserProducts & fn_SamplesUserOffices. The query itself I want to set the rowcount to say 10. However, my functions will return more than 10 rows and obviously they don't due to the set RowCount. I tried to set the RowCount in the function but an error occurs when attempting to compile: Invalid use of 'UNKNOWN TOKEN' within a function. Is there a work-around?
The query is the first part of a complex cross-tab w/o reporting services installed.
SELECT          s.SampleID,
                convert(CHAR(10), s.PullDate, 111) + ' ' + IsNull(S.TripNumber, rtrim(convert(varchar(25), 'N/A' + rtrim(convert(varchar(8), S.SampleID))))) as ColumnName,
                s.PullDate,
                s.TripNumber,
                s.Quantity,
                convert(CHAR(10), s.PullDate, 112) + IsNull(S.TripNumber, rtrim(convert(varchar(25), 'N/A'))) + rtrim(convert(varchar(8), S.SampleID))
FROM      tblSamplesSample s,
      tblSamplesSampleTerminalPortWellLocation stp,
      fn_SamplesUserProducts(@UID) fnp,
      fn_SamplesUserOffices(@UID) fno
WHERE     S.SampleID *= stp.SampleID
AND       (S.Deleted = 0 or S.Deleted IS NULL)
AND       (stp.Deleted = 0 or stp.Deleted IS NULL)
AND       fnp.ProductID = s.ProductID
AND       fno.OfficeID = s.OfficeID
AND       ((@DateRangeBegin IS Null AND @DateRangeEnd IS Null)
  OR    PullDate BETWEEN @DateRangeBegin AND @DateRangeEnd
      )
AND       (@TerminalPortWellLocationID IS Null
  OR   stp.TerminalPortWellLocationID = @TerminalPortWellLocationID
      )
AND       (@CustomerCompanyID IS NULL
      OR   s.CustomerCompanyID = @CustomerCompanyID
      )
AND       (@ProductID IS NULL
  OR   S.ProductID = @ProductID
      )
AND       (@CustomerProductReportID IS NULL
  OR   s.CustomerProductReportID = @CustomerProductReportID
      )
AND       (@DomesticInternational IS NULL
  OR   s.DomesticInternational = @DomesticInternational
      )
AND       S.StatusID = 1 --Finalized
GROUP BY      S.SampleID, S.TripNumber, S.PullDate, s.Quantity
HAVING    Count(stp.TerminalPortWellLocationID) = 1
ORDER BY      s.PullDate DESC, TripNumber ASC, s.SampleID


Thanks,
Michael


I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)e and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
GeneralRe: Set RowCount issue in query containing function tables Pin
-Dr_X-27-Jan-05 5:14
-Dr_X-27-Jan-05 5:14 
Generallock triggers while executing a transaction Pin
mhmoud rawas26-Jan-05 0:28
mhmoud rawas26-Jan-05 0:28 
GeneralRe: lock triggers while executing a transaction Pin
tojamismis27-Jan-05 7:35
tojamismis27-Jan-05 7:35 
GeneralMSDE Setup.Exe and Reinstall Pin
Blake V. Miller25-Jan-05 18:28
Blake V. Miller25-Jan-05 18:28 
QuestionCOMException--Why? Pin
mysorian25-Jan-05 18:02
professionalmysorian25-Jan-05 18:02 
AnswerRe: COMException--Why? Pin
tojamismis27-Jan-05 7:45
tojamismis27-Jan-05 7:45 
GeneralRe: COMException--Why? Pin
mysorian27-Jan-05 17:11
professionalmysorian27-Jan-05 17:11 
GeneralBitwise operators in a SELECT statement Pin
Luis Alonso Ramos25-Jan-05 10:31
Luis Alonso Ramos25-Jan-05 10:31 
GeneralRe: Bitwise operators in a SELECT statement Pin
Michael Potter27-Jan-05 4:12
Michael Potter27-Jan-05 4:12 
QuestionCan I use a generic schema.ini file? Pin
MongooseNX25-Jan-05 9:50
MongooseNX25-Jan-05 9:50 
Generalupdate with conversion Pin
Jesse Evans25-Jan-05 9:11
Jesse Evans25-Jan-05 9:11 
Generalmultivalued fields at ado recordset Pin
moses32125-Jan-05 8:25
moses32125-Jan-05 8:25 
GeneralDatabase Logging Pin
Aaron Schaefer24-Jan-05 11:33
Aaron Schaefer24-Jan-05 11:33 
GeneralRe: Database Logging Pin
tojamismis27-Jan-05 7:58
tojamismis27-Jan-05 7:58 
GeneralEditing/Saving a record selected in a Listbox Pin
frank2124-Jan-05 9:58
frank2124-Jan-05 9:58 
GeneralView Pin
Sebastien Lachance24-Jan-05 4:25
Sebastien Lachance24-Jan-05 4:25 
GeneralRe: View Pin
Mike Ellison24-Jan-05 6:17
Mike Ellison24-Jan-05 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.