关于pb时间表达式的问题

来源:百度知道 编辑:UC知道 时间:2024/05/10 17:00:20
int jd,rq

if month(today())>=1 and month(today())<=3 then
jd=1
else
if month(today())>=4 and month(today())<=6 then
jd=2
else
if month(today())>=7 and month(today())<=9 then
jd=3
else
if month(today())>=10 and month(today())<=12 then
jd=4
end if
以上是求当前日期是哪个季度的,新手,不知道写的是不是很复杂,呵呵
我还想在每个判断里加上当前日期,就是rq是属于什么时间区间的,就是说一季度里的rq>=year(today()).01.01 and rq<=year(today()).03.31,其他季度同样,试了几种写法,总提示语法错,哪为高手帮帮忙哈,谢谢先.,以上是powerbuilder写的.

可以这样写:
jd = Long((Month(Today()) + 2) / 3)

问题中的:
rq>=year(today()).01.01 and rq<=year(today()).03.31
若rq是字符串型,应该写为:
rq>=string(year(today())) + ".01.01" and rq<=string(year(today())) + ".03.31"
但没有必要加日期