True I know how to do it in Access VBA code but I have to be able to filter to only the dated records I need (as Invoice_Detail is a HUGE table) and so I need to know how to write it in SQL...unless I change my form and ask the user to input two dates for the date range (instead of one) -...
SQL above only works if I take out this...
DATEPART(w,'" & Format$([Forms]![TEST_Export Excel files]![txtEnterDate], "yyyy-mm-dd") & "') As WKDY
I've reworked the sql to link in one of my Access tables (deal_items)...this runs without errors...
Dim strSQL As String
Dim strOldSQL As...
Thanks D
That isn't working for me though
Dim strSQL As String
Dim strOldSQL As String
Dim strQueryName As String
strQueryName = "edw_Invoice_Detail"
strSQL = "SELECT receipt_date, PC_Item_Key, DATEPART(w,'" & Format$([Forms]![TEST_Export Excel files]![txtEnterDate], "yyyy-mm-dd") & "') As WKDY...
Well of course I did - just now lol
It works! (only after I changed "pstrQueryName" to "strQueryName" in that last line...must have been a typo?) without errors - I still need to tweak the sql to link in my Access tables - hopefully that will not be another roadblock.
I also need to calculate...
dhookom - there seems to be a problem with the last line of code...
strOldSQL = fChangeSQL(pstrQueryName As String, strSQL As String)
Can you please advise? Thanks.
Understood - so what I'm trying to do is not possible. So I'm fuzzy on how I use the vb code in my pass-through query...can you please explain in more detail how I'd work your code into my query?
I really appreciate all the responses from you guys - you're the best!
Are you sure??? As I read a few posts where people were passing parameters to a PT query and seemed to have had luck doing it...unless they were smokin something (??)
Using a linked table is something I can do but our IT folks aren't going to like me doing that...AND it's going to be MUCH...
Thanks Genomon - but that's not my issue - as I already have Teradata SQL Assistant on my pc - and I frequently use it to query the same table (and others) with no issues that I'm trying to in Access.
I've also researched the Teradata forums and found nothing that helps my situation - in fact...
lameid - that's why included those WHERE statements that did bring back results...
All these work:
--WHERE receipt_date = current_date
--WHERE receipt_date = '2012-04-16'
--WHERE receipt_date = 1120416
--WHERE receipt_date between 1120416 and 1120417
--WHERE receipt_date >= '2012-04-16' AND...
I've searched throughout this site and googled also and have not found any posts that resolves my issue.
I have this sql in a pass-through query in Access 2010...I need the sql to use the date the user enters in the Access form...I get this error however:
ODBC--call failed.
[Teradata][ODBC...
I have nothing yet - because as I said I'm new to VB - I have done macros somewhat before but nothing quite like this situation. I have tried to search for answers in books and online but nothing seems to fit what I'm needing.
I think I spelled out pretty well what I need above - if someone...
I appreciate your responses but with all due respect, you guys are off in left field - all I'm looking for is some VB code to move the data I've brought into my report for each account to a new worksheet.
This is not that complicated of a request - I just don't know how to code it. I don't...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.