使用Excel MS Query从Access中提取数据 [英] Using Excel MS Query to pull data from Access

查看:80
本文介绍了使用Excel MS Query从Access中提取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Excel中使用Microsoft Query从Access数据库中提取数据.我不拥有Access数据库,但是我有权使用我的Excel电子表格查询其表和查询.我正在尝试在明天的01:00:00和第二天的早晨00:00:00之间提取数据.我已经尝试了一切

I'm using Microsoft Query in Excel to pull data from an Access database. I don't own the Access database, but I have permission to query its tables and queries using my Excel spreadsheet. I'm trying to pull data between tomorrow at 01:00:00 and the following morning at 00:00:00. I've tried everything from

WHERE (acct_data.Date Between DATEADD(DAY,1, DateADD(HOUR,1, GETDATE())) And DATEADD(DAY,2, GETDATE())))

WHERE (acct_data.Date Between DATEADD(DAY,1, DateADD(HOUR,1, GETDATE())) And DATEADD(DAY,2, GETDATE())))

以及介于两者之间的所有内容(正确的代码除外).有谁知道从明天的凌晨1点到午夜获取数据的正确语法?

and everything(except the correct code)in between. Does anyone know the correct syntax to get data from tomorrow at 1AM to midnight?

推荐答案

已解决.

WHERE ((([Acct_data]. [Date] Between Date() + 1.04166 And Date() + 2

现在可以使用.我确实从昨天保存的记事本文件中复制并粘贴了文件.我又尝试了一次,以查看收到的错误消息.不知道为什么我今天没有收到任何错误.我想我收到了预期参数"消息.在此过程中,我肯定在其他地方出了问题.

It works now. I literally copied and pasted from a notepad file that I saved it in yesterday. I tried it one more time to see what error message that I was getting. Not sure why I received no error today. I think I was getting a "parameter expected" message. I must have had something wrong somewhere else in the process.

感谢大家的帮助.Ryguy72,如果您不发布该链接,我将放弃该路线.我决定再试一次.

Thanks for your help everyone. Ryguy72, if you wouldn't have posted that link, I would have give up that route. I decided to give it another go.

这篇关于使用Excel MS Query从Access中提取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆