Creating new query

bknight
SilverLounger
Posts: 1679
Joined: 08 Jul 2016, 18:53

Creating new query

Post by bknight »

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.

User avatar
HansV
Administrator
Posts: 80088
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Creating new query

Post by HansV »

TrDate: Int([DateTime])
Best wishes,
Hans

User avatar
Gasman
2StarLounger
Posts: 191
Joined: 22 Feb 2022, 09:04

Re: Creating new query

Post by Gasman »

There are also functions as below. :sad:
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.

bknight
SilverLounger
Posts: 1679
Joined: 08 Jul 2016, 18:53

Re: Creating new query

Post by bknight »

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.

bknight
SilverLounger
Posts: 1679
Joined: 08 Jul 2016, 18:53

Re: Creating new query

Post by bknight »

I think that this is the criteria.
>=Date()-Weekday(Date())+1 And <Date()-Weekday(Date())+8

User avatar
HansV
Administrator
Posts: 80088
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Creating new query

Post by HansV »

You can apply that condition to the DateTime field itself.
Best wishes,
Hans

bknight
SilverLounger
Posts: 1679
Joined: 08 Jul 2016, 18:53

Re: Creating new query

Post by bknight »

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.