sync state
This commit is contained in:
107
OCTPDBA-662 - Export LORE in CSV format for AI/extract.ps1
Normal file
107
OCTPDBA-662 - Export LORE in CSV format for AI/extract.ps1
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
set-location "C:\dev\SSMS projects\OCTPDBA-662 - Export LORE in CSV format for AI"
|
||||
|
||||
Get-ChildItem .\out -Filter *.csv | ForEach-Object {
|
||||
$n = $_.FullName.replace(".csv", "")+".done"
|
||||
#write-output $null >> "$($n).done"
|
||||
Write-Output $null >> $n
|
||||
}
|
||||
20
OCTPDBA-662 - Export LORE in CSV format for AI/query.sql
Normal file
20
OCTPDBA-662 - Export LORE in CSV format for AI/query.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
USE Arizona;
|
||||
GO
|
||||
|
||||
SELECT CONVERT(DATE, [LCL_value_date]),
|
||||
[ITK_key],
|
||||
[ittx].[ITTX_description],
|
||||
[LCL_calculation]
|
||||
FROM [Arizona].[dbo].[LORE_calculation_log] WITH (NOLOCK)
|
||||
JOIN [dbo].[Item_key] WITH (NOLOCK)
|
||||
ON ITK_item = LCL_item
|
||||
AND ITK_type = 1
|
||||
JOIN [dbo].[Item] IT WITH (NOLOCK)
|
||||
ON [IT].[Item_ID] = ITK_item
|
||||
AND [IT].[IT_origin] = 1
|
||||
JOIN [dbo].[Item_text] ittx WITH (NOLOCK)
|
||||
ON [ittx].[ITTX_item] = ITK_item
|
||||
AND [ittx].[ITTX_language] = 103
|
||||
WHERE [LCL_value_date] >= DATEADD(yy, -2, GETDATE())
|
||||
ORDER BY CONVERT(DATE, [LCL_value_date]) DESC,
|
||||
[ITK_key];
|
||||
Reference in New Issue
Block a user