victorlindh
New member
- Local time
- Today, 06:08
- Joined
- Mar 23, 2022
- Messages
- 20
StartDate: GetCurrentDayDates()(0)
EndDate: GetCurrentDayDates()(1)
Where do you want to use it?How do I apply this code?
Code:StartDate: GetCurrentDayDates()(0) EndDate: GetCurrentDayDates()(1)
= GetCurrentDayDates()(0)
= GetCurrentDayDates()(1)
I want to use in a query. Apparently it is not working. Thanks in advance.Where do you want to use it?
In a query, you could use each line as an expression to create a calculated field for each value.
On a form, you could use:
andCode:= GetCurrentDayDates()(0)
as the Control Source properties of two unbound textboxes.Code:= GetCurrentDayDates()(1)
What does "it is not working" mean? Errors? Wrong results? Nothing?I want to use in a query. Apparently it is not working. Thanks in advance.
In that case, I would use the following expressions as calculated fields in the query:I want to use in a query. Apparently it is not working. Thanks in advance.
Why do you want to display the same date twice in the same record?I want to use in a query. Apparently it is not working. Thanks in advance.
Thanks. Works perfectlyIn that case, I would use the following expressions as calculated fields in the query:
startOfDay: DateValue(Now())
endOfDay: DateAdd("s",-1,DateAdd("d",1,[startOfDay]))
Good. Always glad to help if I canThanks. Works perfectly
Thanks. I have encountered a slight problem. I am trying to filter using your expressionsGood. Always glad to help if I can
WHERE >=DateValue(Now()) AND <=DateAdd("s",-1,DateAdd("d",1,[StartOfDay]))
for the current day
WHERE YourDateTimeField >= Date()
AND YourDateTimeField < Date() + 1
In plain words, can you explain what criteria you want to apply?Thanks. I have encountered a slight problem. I am trying to filter using your expressionsCode:WHERE >=DateValue(Now()) AND <=DateAdd("s",-1,DateAdd("d",1,[StartOfDay]))
Can't you share it with us?I have found the solution. Thanks everyone. God bless you so much.
SELECTCan't you share it with us?
SELECT
*,
Now() >= StartDate And Now() < EndDate AS Active
FROM YourTable
I will appreciate if you added input on time element.I hope there is no time element in your fields?
Depends on the values of those date fields.I will appreciate if you added input on time element.
Date() >= DateValue(StartDate) And Date() <= DateValue(EndDate) AS Active