Trying to pull data on what happened in the previous hour but date time is 16 digit string. (ex. 2020041609554089)
When I use date() in criteria , nothing is returned. I can use 2020041609* but I want to make auto report without keying in criteria. any help is appreciated. thank you.
You can convert that string to a true date value: - TrueDate: DateAdd("s", CInt(Val(Right([TextDate], 4)) / 100), CDate(Format(Left([TextDate], 12), "@@@@/@@/@@ @@:@@")))
This you can filter on the normal way, say: - Between DateAdd("h", -1, Now()) and Now()
5 2413
You can convert that string to a true date value: - TrueDate: DateAdd("s", CInt(Val(Right([TextDate], 4)) / 100), CDate(Format(Left([TextDate], 12), "@@@@/@@/@@ @@:@@")))
This you can filter on the normal way, say: - Between DateAdd("h", -1, Now()) and Now()
Got two errors. The first was a space after *4))_/100* which I deleted space. Then the "@@@@/@@.." was highlighted with error saying 'The expression you entered contains invalid syntax. you may have entered an operand without operator.'
I tried changing to:
TrueDate:DateAdd("s",CInt(Val(Right([Date],4))/100),CDate(Format(Left([Date],12),#yyyy/mm/dd hh:mm#)))
with and without " " around #s but got same error.
It runs here, of course, with no error, returning 2020-04-16 09:55:41.
Perhaps your provided sample differs from what you actually have.
Thank you for all your help. This finally worked after refreshing Referencing tool.
TrueDate:DateAdd("s",CInt(Val(Right([Date],4))/100),CDate(Format(Left([Date],12),"@@@@\/@@\/@@ @@\:@@")))
Great! Then please mark as answered.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark Jerzykowski |
last post by:
Hi,
I have a log table which contains the fields log_time (DATETIME) and
session_id (VARCHAR). Using these 2 columns I want to be able to SELECT the
number of users who have been online during...
|
by: cvillard |
last post by:
I am new to SQL, as old as it is. I am not new to programming I
normally just use Access.
I have two tables for a little project manager I made. After updates I
sent an email to the user. I need...
|
by: Jeremy Dillinger |
last post by:
I have a program setup to pull data from a database. My database table has
things such as (category, Item, price, etc.) In my program I want to have
multiple list boxes that will have a pull down...
|
by: jjgardner3.web |
last post by:
Hello I have a very simple xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="./status.xsl"?>
<IEC>
<Workstation>
<Hostname>HOSTNAME</Hostname>...
|
by: jwf |
last post by:
I am writing a NON MFC C++ application (Plug-in for a 3rd party DB system).
The application is designed to synchronise data between MS Outlook and the DB
system. I am using smart pointers for the...
|
by: Ripendra007 |
last post by:
hi all, i want to filter the date which is in label1.text
like
dview.RowFilter = "dir_bdate = '"+label1.Text+" '" ;
here dir_bdate is my DateTime field of database and label1 contains string in...
|
by: amanda27 |
last post by:
I have a database that we use in our department for the status of our projects. In the form when you pick a project from the dropdown list I have a subform that pulls the data entered for the...
|
by: sunkesula |
last post by:
I update a field in the database that gives the last update time.
The first time I edit the item it puts a value in this field.
The second time the applications fails with The statement has...
|
by: JM420A |
last post by:
Access 2k3
Query:
I have a string: DOE JOHN MICHAEL (last first middle)
I need to pull JOHN out of it
I can pull out DOE, and get the length of DOE, what I'm having trouble with is how...
|
by: lwc0724 |
last post by:
I need to pull data based on anything >Date()-2 3:00pm How would I do this to input into a query?
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
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: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |