Hi,
My query contains three fields: Lot, Status, and Timestamp. I've sorted the query by ascending Timestamp values and would like to assign a row number ID to each row. I've tried using:
ID: DCount("Timestamp","Weighing","[Timestamp] <=" & [Timestamp])
but Access keeps returning errors and tells me that I have a syntax error. Is this because my DCount criteria involves dates?
Any help would be much appreciated!
You should add '#' before, and after, the '[Timestamp]'
(see: this link)
ID: DCount("Timestamp","Weighing","[Timestamp] <=#" & [Timestamp]) & "#"
3 1668 Luuk 1,047
Expert 1GB
You should add '#' before, and after, the '[Timestamp]'
(see: this link)
ID: DCount("Timestamp","Weighing","[Timestamp] <=#" & [Timestamp]) & "#"
Luuk 1,047
Expert 1GB
But, after i tried this meself.....
I create a table 'Tabel2' with the field 'datum'
Than this query: -
SELECT
-
DCount("[datum]","[Tabel2]","[Datum]<=#" & [datum] & "#") AS DCOUNT1, Tabel2.datum,
-
month(datum) AS month
-
FROM Tabel2
-
WHERE (((Tabel2.datum) Between #1/1/2000# And #1/12/2000#));
-
gave me this result: - DCOUNT1 datum month
-
95407 1-1-2000 1
-
95438 2-1-2000 1
-
95467 3-1-2000 1
-
95498 4-1-2000 1
-
95528 5-1-2000 1
-
95559 6-1-2000 1
-
95589 7-1-2000 1
-
95620 8-1-2000 1
-
95651 9-1-2000 1
-
95681 10-1-2000 1
-
95712 11-1-2000 1
-
95742 12-1-2000 1
now i'm left puzzled, why does this first column increment with 31 (or 30 after 9-1-2000) ?
Luuk 1,047
Expert 1GB
hmm, why do i find the answer just after posting my question?
The correct result is return with this query - SELECT
-
DCount("[datum]","[Tabel2]","[Datum]<=#" & FORMAT(datum,"yyyy-mm-dd") & "#") AS Expr1,
-
Tabel2.datum,
-
FORMAT(datum,"yyyy-mm-dd"),
-
Month(datum) AS [month]
-
FROM Tabel2
-
WHERE (((Tabel2.datum) Between #1/1/2000# And #1/12/2000#));
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steven Stewart |
last post by:
Hi there,
I have a query (QueryB) that is based on the results of another query
(QueryA).
When I open QueryB itself, it displays the exact records that I want. I
have a report based on...
|
by: Greg Iocco |
last post by:
Simple problem, but I've checked the newsgroups and couldn't find an
answer.
On the main swithboard is a command button to open a report. The
report I built is based off a query, and the query...
|
by: Keith |
last post by:
Good Afternoon,
New to .Net. I am trying to pass date/time values to a MS Access query depending on what value is selected from a dropdown list box (January, February, etc). I have declared...
|
by: amith.srinivas |
last post by:
Hi all,
From a word macro in VBA, I am trying to create a report in
access DB. The report is based on a query with a parameter. I am using
Set rpt = Application.CreateReport
rpt.RecordSource =...
|
by: gretchen |
last post by:
I'm a fairly new access user so my question may be simple but I still need help! I have a form and a subform. I want to run an append query and populate the subform based on values in the form. I...
|
by: BerkshireGuy |
last post by:
I have two functions that calculate two numbers based on based in
parameters. So, the functions return a value.
Is there a way to create a chart based on values from a function?
The only...
|
by: bubbles |
last post by:
Newbie transiting from VBA to TSQL, using SQL Server 2005 Enterprise:
Need help to do this:
Open Table_A
WITH TableA
DO UNTIL .EOF
Read value from TableA.ColumnA
Run SQL Statement on...
|
by: neha02 |
last post by:
Hi all,
this is my first post here although i've always referred this forum for help.
I am trying to design a query based on 4 queries but i'm unable to get the result i want. Please help me-...
|
by: Ferasse |
last post by:
Hi,
I'm an occasional Ms-Access developer, so there is still a lot of stuff that I don't get...
Right now, I'm working on a database that stores contractual information.
One of the form that...
|
by: gnawoncents |
last post by:
I have a form (FRMsurveyReports) with several combo boxes (e.g. Class, ClassUnique, SurveyID, etc.) which use an SQL query based on a table (TBLSurveyResponses) for their record source. The...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |