Hi there Fishval,
First of all I'd like to thank you for the nice and extensive comment.
Sadly enough, I cannot it to work entirely. I've replaced (textual replace) some values in your query. When I execute that Query, I get the results I want to have. That's good.
However, as soon as I make this query a subquery of an "INSERT INTO" statement, Access returns an error (Syntax ERROR in INSERT statement)....
User Profile
Collapse
-
Compute table difference
Hi All,
I have to tables with an identical structure. I want to compute the difference between this tables (probably by using some SQL statement).
Question is, how to do so?
Layout of the tables: (SomeID, Name, Date). Primary key: the whole structure (no, SomeID can't be used for key, autonumber field will not work either).
I'd be glad to use an EXCEPT of MINUS construction, but these seem... -
Thanks guys!!! I solved it by adding the #'s! How stupid of me!
Cya!Leave a comment:
-
Hi Jim,
Thanks for your help!
I fiddled around a bit with the format function, but, I cannot get it to work, whatever I try. I even tried to manually add a date (in different formats) in my SQL query, but I always get a empty result! When I replace the Datum field by another column, it all works well.
Any guesses?
Thanks agian!...Leave a comment:
-
Comparing dates in VBA / SQL
Hi,
I'm trying to write some VBA script which uses date in an SQL statement:
Code:SQL1 = "INSERT INTO Contractrealisatie (Medewerker,Uren) SELECT Planning.Werknemer, (15*(Planning.[Stoptijd] - Planning.[Aanvangstijd])) FROM Planning WHERE ([Datum] = " & CorrectedDate & ")"
-
Whatever I try, I can't get it to work.
For example, I try:
[code
SQL = "SELECT * FROM Werknemers WHERE DateDiff('d', Format(DateSeri al(Year(Now),Mo nth(Geboortedat um),Day(Geboort eDatum)), 'Short Date'), Format(Date, 'Short Date') ) BETWEEN 0 AND 5;"
[/code]
This keeps on giving error 3601... while I can't find any problem.. any clues?...Leave a comment:
-
Thanks all. Doing it the dirty way (testing on the size of the recordset) is what does the trick..
Thanks!Leave a comment:
-
DAO OpenRecordset and NULL results?
Using the code hereunder, I query my database (from MS Access VBA code). Some of my queries give empty results, which isn't like by my program.
For example:
Code:R5SQLC1 = "SELECT COUNT(*) FROM Planning AS D1, Planning AS D2 WHERE D1.werknemer=" & TheWorker & " AND D2.werknemer=" & TheWorker & " AND (D1.AanvangsTijd <= D1.Stoptijd) AND (DateDiff('d', D1, D2) = 1) AND (((D2.AanvangsTijd
-
RobinDiederen started a topic How to use single point SQL results in Access VBA codein Visual BasicHow to use single point SQL results in Access VBA code
Suppose I write a SQL query, giving a single point result (for instance, SELECT COUNT(*) FROM persons). After doing the query, I want a assign it's result to a variable with the identical type. How do I do that?
For example:
Code:SQL = "SELECT COUNT(*) FROM persons" Set Db = CurrentDb Set rst = Db.OpenRecordset(SQL, dbOpenDynaset)
-
-
Compare dates in Access SQL?
Suppose, I want to compare 2 dates in an SQL query, running from Access (from VB code) like this:
"SELECT * FROM Plan WHERE Date1 > Date2"
Will that work? Thanks in advance! -
Thanks a lot!
Another question: can this be domne the other way around to? Can I access to give me, for example, the date of the first day of a week?...Leave a comment:
-
Thanks, I'm still tinkering with this though..
I'm currently trying
Code:SQL = "SELECT * FROM Employees WHERE DateDiff('d', Format([DoB], 'General Date'), Format(Date, 'General Date') ) BETWEEN 0 AND 5;" Set rs = db.OpenRecordset(SQL, dbOpenDynaset)
Leave a comment:
-
Oooh thanks a lot, I'll be trying that this afternoon!!!!!...Leave a comment:
-
Week number calculations
Hi,
Suppose I have a date, is there some way I can use Access to calculate the week number the date is in? And if so, can Access take notice of leap years?
Thanks! -
Actions on multiple records
Hi,
For a set of records, which I get by doing a SELECT on a database, I want to some computations. After doing those computations, I want data, based on those computations to be stored in another table in the database. I just can't figure out how to do this.
For example:
1. do the select (like selecting all male employees from the database)
2. insert those records into another table, with, if their date... -
Powerpoint presentation on website (HTML)?
I have a Powerpoint presentation I want to show on a website. I know that Word documents, Excel sheets etc can be showed on a HTML page, in a way so that the frame containing them is filled with this kind of document. What I really want is the ability to start a slideshow in a HTML frame (which of coures requires the viewer to have PowerPoint installed). Can this be done? (I know converting to PDF is an option, but I'd rather not go there)
... -
Access / SQL query
I'm trying to calculate, from a SQL statement, the count of days to a persons birthday.
I'm trying the following:
strSQL = "SELECT * FROM Employees WHERE (DateDiff('d', Date, (DateSerial(Mon th([DateOfBirth]),Day([DateOfBirth]),Year(Date))) BETWEEN 0 AND 5"
The [DateOfBirth] is a field in the Employees table. Yet, I always receive a 3061 runtime error... anybody got any idea what is wrong? Yes, there... -
Python list of class attributes
Hi all,
I'm a relative newby to the Python programming language. I need to make a list of all the attributes of a(n) (instanced) class. Is there any standard function in Python that can do this?
Thanks in advance, Robin
No activity results to display
Show More
Leave a comment: