Click here to Skip to main content
15,917,632 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How we can get last 12 months using current month using sql Pin
Mycroft Holmes9-May-16 21:37
professionalMycroft Holmes9-May-16 21:37 
GeneralRe: How we can get last 12 months using current month using sql Pin
MANISHA SONAWANE10-May-16 0:02
MANISHA SONAWANE10-May-16 0:02 
GeneralRe: How we can get last 12 months using current month using sql Pin
Mycroft Holmes10-May-16 0:12
professionalMycroft Holmes10-May-16 0:12 
AnswerRe: How we can get last 12 months using current month using sql Pin
CHill6010-May-16 22:22
mveCHill6010-May-16 22:22 
SuggestionRe: How we can get last 12 months using current month using sql Pin
Richard Deeming11-May-16 1:23
mveRichard Deeming11-May-16 1:23 
GeneralRe: How we can get last 12 months using current month using sql Pin
CHill6011-May-16 2:08
mveCHill6011-May-16 2:08 
GeneralRe: How we can get last 12 months using current month using sql Pin
Mycroft Holmes11-May-16 2:51
professionalMycroft Holmes11-May-16 2:51 
GeneralWe want only required Month and Year instead of complete date in where condition using sql Pin
MANISHA SONAWANE16-May-16 0:05
MANISHA SONAWANE16-May-16 0:05 
QuestionDisplay status of SQL query in VBA Pin
Member 124051985-May-16 4:57
Member 124051985-May-16 4:57 
AnswerRe: Display status of SQL query in VBA Pin
Dave Kreskowiak5-May-16 12:25
mveDave Kreskowiak5-May-16 12:25 
AnswerRe: Display status of SQL query in VBA Pin
Mycroft Holmes8-May-16 14:21
professionalMycroft Holmes8-May-16 14:21 
GeneralRe: Display status of SQL query in VBA Pin
Member 124051989-May-16 4:39
Member 124051989-May-16 4:39 
GeneralRe: Display status of SQL query in VBA Pin
Dave Kreskowiak9-May-16 4:50
mveDave Kreskowiak9-May-16 4:50 
AnswerRe: Display status of SQL query in VBA Pin
Sascha Lefèvre9-May-16 5:28
professionalSascha Lefèvre9-May-16 5:28 
AnswerRe: Display status of SQL query in VBA Pin
Patrice T9-May-16 5:42
mvePatrice T9-May-16 5:42 
GeneralRe: Display status of SQL query in VBA Pin
Member 124051989-May-16 8:52
Member 124051989-May-16 8:52 
OK - well - it works. The user doesn't see the records, all I do is ask the user between what dates then I use that as input to the SQL. So they get a slice of the file. I write that out then I do a join to a third file and write out that file. That end file is used as input for a pivot table. Therefore except for initially asking the date range, there is no user presentation except via the pivot table which is extremely fast because by then I have trimmed all the fields I don't want and all the records I don't want.

Originally I was trying to do this as SQL in Excel itself through the SQL Editor but note well that if you try to have more than two tables in joins in a query it will not work. (I posted this in SQL questions already). That is why I went to VBA in the first place. So I open a box, get the date from the user, process the records, then refresh the pivot. It seems to work well. Technically I -might- be able to combine the two queries but really for clarity sake it's almost better as 2 queries because I do field reformatting and so on. Yes doing two writes instead of one is slower so I may check this out later however I have something that works. I am of course open to suggestions how could it be better - but I don't see a horrible performance issue (yet). I think what happens is when you set a recordset equal to an SQL statement, it doesn't really run it until you try to open the recordset. Which would kind of make sense, I guess.

Thanks for all help, many thanks.
GeneralRe: Display status of SQL query in VBA Pin
Member 124051989-May-16 8:59
Member 124051989-May-16 8:59 
GeneralRe: Display status of SQL query in VBA Pin
Patrice T9-May-16 9:41
mvePatrice T9-May-16 9:41 
GeneralRe: Display status of SQL query in VBA Pin
Member 124051989-May-16 9:53
Member 124051989-May-16 9:53 
GeneralRe: Display status of SQL query in VBA Pin
Patrice T9-May-16 10:31
mvePatrice T9-May-16 10:31 
GeneralRe: Display status of SQL query in VBA Pin
Member 124051989-May-16 13:00
Member 124051989-May-16 13:00 
AnswerRe: Display status of SQL query in VBA Pin
Patrice T9-May-16 16:21
mvePatrice T9-May-16 16:21 
GeneralRe: Display status of SQL query in VBA Pin
Member 124051989-May-16 10:05
Member 124051989-May-16 10:05 
AnswerRe: Display status of SQL query in VBA Pin
Mycroft Holmes9-May-16 14:25
professionalMycroft Holmes9-May-16 14:25 
GeneralRe: Display status of SQL query in VBA Pin
Member 1240519811-May-16 3:27
Member 1240519811-May-16 3:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.