Question Drew Holloway · Mar 12, 2020

Is there a way to query the database structure?  In SSMS there are queries for finding tables with a column with a certain name (using LIKE).  And there is the redgate tool SQL Search.  But I'm not sure how to go about looking for columns that have say a value of 'PATID' and returning all tables that match.  Does anyone know?

5
0 1761
Question Drew Holloway · Feb 28, 2020

In T-SQL, I can create a recursive CTE to create a subquery or a view that will hold a whole lot of numbers.  Is there a way to do this in Cache SQL?  I'd like the numbers from 0 to 10000 if possible. 

Thanks!

3
0 348
Question Drew Holloway · Feb 28, 2020

Let's say I start with a date range of '1-5-2019' to '5-25-2019' that occurs on one row.  I'd like to ultimately have this show as 5 rows in Crystal Reports as shown below

Result

1-5-2019  1-31-2019

2-1-2019 2-28-2019

3-1-2019 3-31-2019

4-1-2019 4-30-2019

5-1-2019 5-25-2019

I found a result that worked in T-SQL, but I'm not sure how to translate it to Cache SQL.  The T-SQL code is

select dateadd(d,N.number,d.begindate) adate, data
  from data d
  join Numbers N ON number between 0 and datediff(d, begindate, enddate)

3
0 408