小编Rah*_*dya的帖子

如何在oracle中找到一年前这一天的数据?

圣诞节快乐,

我使用下面的查询来获取价格,但我的要求是从 trunc(sysdate) 获取过去一年的数据。我尝试过使用 DATEADD 函数,但它给了我一个错误

cast(p.asof as DATE) = cast(DATEADD(Year, -1, GETDATE()) as DATE)

select idvalue, p.asof as DATE_, p.instrument, p.price
from instruments i
inner join prices_equity_closing p on p.instrument = i.pkey
inner join instruments_ids id on i.ids = id.idset
where
id.idvalue in ('MRVE3.SA')
and id.idtype in ('RIC')
and p.asof = trunc(sysdate)-1
order by i.exchange, i.type, p.asof desc;
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮忙,我需要进行哪些更改才能获得所需的结果?

sql oracle

3
推荐指数
1
解决办法
3223
查看次数

如何根据单元格值插入空白行

我试图在 C 列中查找单元格值,如果单元格不包含点(“.”),则在该单元格上方插入一个空白行。

我尝试了以下宏:

Sub testing()
    Dim col As Variant
    Dim lr As Long
    Dim i As Long
    Dim startRow As Long

    col = "C"
    startRow = 2
    lr = Cells(Rows.Count, col).End(xlUp).Row

    With ActiveSheet
        For i = lr To startRow Step -1
            If IsNumeric(Range("E2", "E" & lr).Value) = True Then
                .Cells(i + 1, col).EntireRow.Insert shift:=xlUp
            End If
        Next i
    End With
End Sub
Run Code Online (Sandbox Code Playgroud)

输入

输入

所需输出

输出

excel vba

1
推荐指数
1
解决办法
1204
查看次数

标签 统计

excel ×1

oracle ×1

sql ×1

vba ×1