I have a Db that contains a field Date and another field Time. Queries were made from the time field similar to TrDate: Int(([NinjaTrader2024].[Time])) and this calculated field is used in other queries.
I have another Db that has a Date/Time field. What I would like to do is to use the date part of this field into a similar form. How could this be accomplished? Something like TrDate:Int(Day([[DateTime]).....)etc? This will be used to group daily trades.
Creating new query
-
- Administrator
- Posts: 80088
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 2StarLounger
- Posts: 191
- Joined: 22 Feb 2022, 09:04
Re: Creating new query
There are also functions as below.
DateValue()
TimeValue()

DateValue()
TimeValue()
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- SilverLounger
- Posts: 1679
- Joined: 08 Jul 2016, 18:53
Re: Creating new query
I had a query that used the TrDate: Int([DateTime]) with criteria of this Monday through Friday criteria accompanied with a couple of summed fields that I would like to output. I searched for it last night and this morning without finding it.
-
- SilverLounger
- Posts: 1679
- Joined: 08 Jul 2016, 18:53
Re: Creating new query
I think that this is the criteria.
>=Date()-Weekday(Date())+1 And <Date()-Weekday(Date())+8
>=Date()-Weekday(Date())+1 And <Date()-Weekday(Date())+8
-
- Administrator
- Posts: 80088
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- SilverLounger
- Posts: 1679
- Joined: 08 Jul 2016, 18:53
Re: Creating new query
Ok, I put it in the TrDate: Int([DateTime]) and it appears to be working, so one more fix from the install new op system.