| |

VerySource

 Forgot password?
 Register
Search
View: 1166|Reply: 9

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-18 23:30:01
| Show all posts |Read mode
Is the ACCESS database, the record format is as follows:

2015-4-6 17:30:07
2015-7-25
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-6-24 07:45:02
| Show all posts
Everyone remembers the ACCESS library
Reply

Use magic Report

1

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-27 14:00:02
| Show all posts
Between #"&year(now)&"-"&month(dateadd("m",-1,now))&"# And #"&year(now)&"-"&month(now)&"#
Just like this format
Time query should be in the format of idea. Do not use fuzzy query of characters. It’s okay to check the month between 2 and April. It’s not very clear. Try this, if you can't, change the time
Between #2015-3# And #2015-4#
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-6-27 19:45:02
| Show all posts
where datediff('m', field, '2015-03-01') = 0
Reply

Use magic Report

1

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-27 23:15:01
| Show all posts
Field Between #2015-3# And #2015-4#
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-29 10:45:01
| Show all posts
"select ... where cstr(year(time field))+'-'+cstr(month(time field))='"&year(yourtime)&"-"&month(yourtime)&"'"

But it is best to use:
time_temp=year(yourtime)&"-"&month(yourtime)&"-1"
"select ... where field>=cdate('"&time_temp&"') and field<dateadd('m',cdate('"&time_temp&"'),1) "

So the index is faster
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-8 18:30:02
| Show all posts
where Year(field)= and Month(field)=
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-8 20:30:01
| Show all posts
Upstairs said:
The landlord overlooked a problem, that is, the format of the date converted to a string (yyyy-MM-dd, MM-dd-yyyy.....)
The correct way is:
select *
from table name
where Year (date field) = 2015 and Month (date field) = 7 and Day (date field) = 20
Use the three date functions Year, Month, and Day respectively to find the year, month, and day of the date field.
Reply

Use magic Report

0

Threads

24

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-7-8 20:45:01
| Show all posts
Use # in the access time, such as: #2015-7-25#, this is different from the SQL database

I think:
Like, you can replace it with >,=,<This way!
Reply

Use magic Report

0

Threads

15

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 Japan

Post time: 2020-7-9 00:45:01
| Show all posts
like'*2015-3*'
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list