Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当对Access数据库进行查询时,如果被查询的字段是日期类型,生成的SQL语句异常 #1724

Closed
AndiceHuang opened this issue Jan 20, 2024 · 0 comments

Comments

@AndiceHuang
Copy link

AndiceHuang commented Jan 20, 2024

问题描述:
当C#连接Access数据根据日期字段进行查询时,生成的SQL 语句有误,Access用单引号包含字符串,但用# 包含时间,所以如果日期是用的Access的日期格式,那么在Where条件中需要用# 来包含日期。

有问题的查询语句截图(Freesql自动生成)
4I_~F)PJ%8 @T@D%H`RR8_J

Access表字段数据格式
Q%8(8E~OP}FW9IEID_XQ@@8

Access能正常运行的查询语句
57P$Z~6A@B2@P}7M1QCL{_Y

测试代码和数据库文件如下:

ConsoleApp1.zip

@AndiceHuang AndiceHuang changed the title 当对Access数据库进行时间范围查询时,生成的SQL语句触发异常 当对Access数据库进行查询时,如果被查询的字段是日期类型,生成的SQL语句异常 Jan 20, 2024
2881099 added a commit that referenced this issue Jan 29, 2024
2881099 added a commit that referenced this issue Feb 1, 2024
@2881099 2881099 closed this as completed Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants